test

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • pavit Moderator
    #1033682

    Hello

    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 Friend
    #1035463

    Thanks 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-position

    1º. 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 Moderator
    #1035469

    What 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.


    1. Screenshot-at-mag-19-19-09-13
    2. Screenshot-at-mag-19-19-10-22
    3. Screenshot-at-mag-19-19-31-14
    4. Screenshot-at-mag-19-19-31-26
    modalia Friend
    #1035483

    Thank 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"   />
Viewing 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.