Tagged: ja mazg II
-
AuthorPosts
-
pavit Moderator
pavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
May 13, 2017 at 7:43 am #1033682Hello
Article view is using a sublayout , you can create a specific sublayout (with your module position ) and then assign module you want in category view only in position specified in main layout .
Hope it helps.
modalia Friendmodalia
- Join date:
- June 2011
- Posts:
- 96
- Downloads:
- 12
- Uploads:
- 49
- Thanks:
- 39
- Thanked:
- 7 times in 1 posts
May 19, 2017 at 4:40 pm #1035463Thanks for your response and help. I followed Joomlart’s instructions to create a new module, but I get:
Call to undefined method ContentViewCategory::_p()
I followed these indications: Add new module position
http://www.t3-framework.org/documentation/bs3-layout-system#add-position1º. Add this in: /html/com_content/category/blog.php
<!-- end row --> <?php endif; ?> <?php endforeach; ?> </div> <?php endif; ?> <?php echo JLayoutHelper::render('joomla.content.pagination', array('params'=>$this->params, 'pagination'=>$this->pagination)); ?> <!-- category-section --> <div> <jdoc:include type="modules" name="<?php $this->_p('category-section') ?>" /> </div> <!-- //category-section --> </div>
2º. Add this in: /templateDetails.xml
<position>banner-top</position> <position>head-social</position> <position>leading-sidebar</position> <position>section</position> <position>category-section</position> </positions>
But when deleting cache, category view shows the error: Call to undefined method ContentViewCategory::_p()
What do you think the error is? Any suggestions?
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
May 19, 2017 at 5:32 pm #1035469What do you think the error is? Any suggestions?
Hello
Maybe there was a misundertanding, i was not saying to create a new module but only change layouts type from template manager.
Category view is using a main layout ( img-1)
article view is using a sublayout ( img-2)So what i was saying is to create/assign a new position to the sublayout and assign your module to that position so it can be viewed only in article view
Example :
You can use as main layout the default-no-sidebar and as sub-layout the default-content-left layout
Then you can modify the sidebar-2 position changing it to a position name sidebar-3 after you have added your position name in templateDetaills.xml file
Hope was enough clear.
- modalia Friend
modalia
- Join date:
- June 2011
- Posts:
- 96
- Downloads:
- 12
- Uploads:
- 49
- Thanks:
- 39
- Thanked:
- 7 times in 1 posts
May 19, 2017 at 6:36 pm #1035483Thank you very much for your help. I will consider your advice in the future. For now, I’ve solved it by adding a new position in the category view.
Instead of this code that gave me error:
<div> <jdoc:include type="modules" name="<?php $this->_p('category-section') ?>" /> </div>
I used this:
<jdoc:include type="modules" name="category-section" />
AuthorPostsViewing 4 posts - 1 through 4 (of 4 total)This topic contains 4 replies, has 2 voices, and was last updated by modalia 7 years, 7 months ago.
The topic ‘Show module only in category view, but not in article view’ is closed to new replies.
Jump to forum