test melih
 melih
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • erickpaulino Friend
    #986758

    Hello,

    I am trying to add a new module position right at the end of articles, BEFORE the "You may also like" feature. I have read the instructions on https://www.joomlart.com/forums/topic/how-to-create-new-module-position-updated/ , but since the "you may also like" feature is hardcoded in the content block, I had no luck making it work. I can only put it after the "you may also like", which is not what I want.

    Can you please help me?

    Thank you,

    Erick

    Ninja Lead Moderator
    #987124

    Hi,

    You can follow this way to load the new position after "You may also like"

    • Create new module and assign this module with new-position position

    • Open templates/ja_magz/html/com_content/article/default_related.php file and add the source code below under <h2 class="header-related"><?php echo JText::_(‘TPL_TITLE_RELATED’)?>
    1. <?php
    2. // position needs to load
    3. $load_modules = 'new-position';
    4. $attrs = array();
    5. $result = null;
    6. // Call the module
    7. $renderer = JFactory::getDocument()->loadRenderer('modules');
    8. $ads = $renderer->render($load_modules, $attrs, $result);
    9. // display the module
    10. if ($ads) :
    11. ?>
    12. <div>
    13. <?php echo $ads ?>
    14. </div>
    15. <?php endif ?>

    Please make a backup old file before doing changes

    Regards

    erickpaulino Friend
    #987285

    Thank you! It works!

    It just doesn’t load the module name/title. How can I add it?

    Erick

    Ninja Lead Moderator
    #987437

    Hi Erick,

    I tried to find the load module title and name on this way but I could not see the option to support about this, it only loads the contact on this way.

    Or you can apply other ways here

    Regards

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 3 replies, has 2 voices, and was last updated by  Ninja Lead 8 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum