-
AuthorPosts
-
January 10, 2014 at 12:59 am #193640
How can I add the bonus menu in all my articles?
MoonSailor FriendMoonSailor
- Join date:
- November 2011
- Posts:
- 1106
- Downloads:
- 0
- Uploads:
- 245
- Thanks:
- 89
- Thanked:
- 248 times in 223 posts
January 10, 2014 at 3:45 am #517982A few steps below would help you get the feature:
– First, you needs created new module menu:
+ Go to administrator -> modules manager -> click “New ” button then select “menu”
+ Set “Select Menu” with “the bonus menu”:
+ Assign the module position as “load-mod-in-art”
– Second, put the module inside the article content:
You need to open articles where you want this module to appear and insert following code {loadposition load-mod-in-art} in the article content:See this document for more reference: http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F
You do the same for all articles.
Extra note:
If you want the module to appear before or after content of article, open the file “default.php” in folder “templates/ja_appolio/html/com_content/article”, then replace:
<section class="article-content clearfix">
<?php echo $this->item->text; ?>
</section>
With:
<section class="article-content clearfix">
<?php
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');$params = array('style'=>'-2');
$contents = '';
foreach (JModuleHelper::getModules('load-mod-in-art') as $mod)
{
if($ovparams){
$modparams = json_decode($mod->params);
$modparams->created_by = $ovparams->created_by;
$mod->params = json_encode($modparams);
}
$contents .= $renderer->render($mod, $params);
}
?>
<?php echo $this->item->text.$contents; ?>
</section>
Hope that helps.
-
January 10, 2014 at 4:14 pm #518083
What if I wanted it to be on the top of the page?
Like the image attached, my bonus menu is the one on the top pf the page, but it only appears on that article.
MoonSailor FriendMoonSailor
- Join date:
- November 2011
- Posts:
- 1106
- Downloads:
- 0
- Uploads:
- 245
- Thanks:
- 89
- Thanked:
- 248 times in 223 posts
January 13, 2014 at 2:20 am #518162<blockquote>
What if I wanted it to be on the top of the page?
</blockquote>In your screenshort, I see only megamenu – not any menu added. Could you explain in more details?
AuthorPostsViewing 4 posts - 1 through 4 (of 4 total)This topic contains 4 replies, has 2 voices, and was last updated by MoonSailor 10 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum