The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sat Sep 12, 2009 12:21 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 08, 2009 6:16 pm
Posts: 38
I'm trying to add my sub-navigation menu to my article layout. I don't want this on every page, just articles. So a simplified example of what I'm trying is:

Code:
<div id="left">
   <jdoc:include type="modules" name="subnav" style="xhtml" />
</div>
<div id="right">
 ... code to display article
</div>


But this is not working.

When I put the jdoc::include on my theme's index.php it shows up, but when I put it in my override, it does not so I must be missing how this works?

How do I output a module to a dedicated spot in an override?


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 12:32 am 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Thu Jul 24, 2008 12:48 pm
Posts: 2678
Location: Austin, TX
I don't know if you can use the jdoc:include in html overrides. I assume that tag is actually being rendered to your page if you view the source?

I just recently stumbled upon this (with help from another forum poster). Pretty cool way to output modules anywhere. Perhaps you can use this syntax?
http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F

_________________
Will Mavis - Joomla Developer
http://www.covertapps.com/jam <<< Joomla! on your Android, iPhone, iPad, and iPod Touch
If you think I can help you, PM me a link to your post and I will respond. Please don't hijack another user's thread.


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 12:39 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 08, 2009 6:16 pm
Posts: 38
wlrdq wrote:
I don't know if you can use the jdoc:include in html overrides. I assume that tag is actually being rendered to your page if you view the source?


Yes, it is just rendering that tag in the source.

Quote:
I just recently stumbled upon this (with help from another forum poster). Pretty cool way to output modules anywhere. Perhaps you can use this syntax?
http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F


Yeah, not helpful here though. I've used that for other problems...but that doesn't apply to what I'm doing. I just want a side menu to appear when you are viewing an article that shows other menu items from the same menu. I'm sure there's a VERY easy way to do this.

I don't want the menu within my article, and I need to wrap two div tags around the menu.

I want the menu WITH my article, but not within the article content on every article in the section. I just need the menu beside the article...

Thanks anyway.


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 3:22 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Thu Jul 24, 2008 12:48 pm
Posts: 2678
Location: Austin, TX
How about adding code to call the JModuleHelper renderModule method?
http://api.joomla.org/Joomla-Framework/Application/JModuleHelper.html#renderModule

Let me know if you need help figuring out the code to add.


Another option would be to add code directly in your template that looks at the query string to see if option=com_content and view=article and then adds the jdoc:include tag.

Again, let me know if you need help adding this.

_________________
Will Mavis - Joomla Developer
http://www.covertapps.com/jam <<< Joomla! on your Android, iPhone, iPad, and iPod Touch
If you think I can help you, PM me a link to your post and I will respond. Please don't hijack another user's thread.


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 9:21 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 08, 2009 6:16 pm
Posts: 38
Thanks, some help would be great!

Also, I don't want one subnav on all articles, but I want that section's subnav - or the menu that was used to arrive at this article's display. What I'm trying to achieve is what's on this page:

http://www.gigoptix.com where each section has its own sub-nav.


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 9:38 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Thu Jul 24, 2008 12:48 pm
Posts: 2678
Location: Austin, TX
I typically do that kind of subnav functionality by having sub menu items and then creating another instance of mod_mainmenu on the left side of the page and have it only display that sub menu level.

This post may help:
http://docs.joomla.org/Tutorial:Creating_a_submenu


I think there are other modules to help you do what you want.

Let me know if you still can't figure it out.

_________________
Will Mavis - Joomla Developer
http://www.covertapps.com/jam <<< Joomla! on your Android, iPhone, iPad, and iPod Touch
If you think I can help you, PM me a link to your post and I will respond. Please don't hijack another user's thread.


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 9:38 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 08, 2009 6:16 pm
Posts: 38
Got it:
I can finish from here.

Code:
<div id="sidenav">
      <?php
         jimport( 'joomla.application.module.helper' );
         $module = JModuleHelper::getModule( 'mainmenu', 'Company' );
         $attribs['style'] = 'xhtml';
         echo JModuleHelper::renderModule( $module, $attribs );
         
      ?>
   </div>



That's what I was fishin' for. Thanks a ton!


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 9:56 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Thu Jul 24, 2008 12:48 pm
Posts: 2678
Location: Austin, TX
No problem. Glad I could help.

_________________
Will Mavis - Joomla Developer
http://www.covertapps.com/jam <<< Joomla! on your Android, iPhone, iPad, and iPod Touch
If you think I can help you, PM me a link to your post and I will respond. Please don't hijack another user's thread.


Top
 Profile  
 
PostPosted: Mon Sep 14, 2009 3:22 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Jul 21, 2009 3:30 pm
Posts: 226
Location: United Kingdom
if you just want to load a module within an article why not type "{loadposition menu}" into an article and change the module position to "menu"

_________________
-- Aaron Harding - Qlue --
-- http://www.qlue.co.uk --


Top
 Profile  
 
PostPosted: Mon Sep 14, 2009 3:31 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Thu Jul 24, 2008 12:48 pm
Posts: 2678
Location: Austin, TX
I believe techism wants the menu to show up for all articles and doesn't want to have to manually add that to every article. Make sense?

_________________
Will Mavis - Joomla Developer
http://www.covertapps.com/jam <<< Joomla! on your Android, iPhone, iPad, and iPod Touch
If you think I can help you, PM me a link to your post and I will respond. Please don't hijack another user's thread.


Top
 Profile  
 
PostPosted: Mon Sep 14, 2009 3:46 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Jul 21, 2009 3:30 pm
Posts: 226
Location: United Kingdom
Sorry i miss read, i guess my way works if u want to do it manually :-[

_________________
-- Aaron Harding - Qlue --
-- http://www.qlue.co.uk --


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 



Who is online

Users browsing this forum: Exabot [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group