How to show module only in article view,not in category blog

Everything to do with Joomla! 2.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
irenamarkovic
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sat Aug 13, 2011 4:44 pm
Contact:

How to show module only in article view,not in category blog

Post by irenamarkovic » Mon Jan 07, 2013 5:11 pm

Hi,

I would like to show certain module only in article view. I don't want to use {loadposition modulename} on every article, but to "tell" joomla not to show a module unless article view is shown.

I've read somewhere to insert this code, but I think something is not ok with that

if ($option == "com_content" and $view == "article") return XXX;

where XXX is a module number.


Any suggestion?
Thanks!

jtut
I've been banned!
Posts: 429
Joined: Thu Nov 24, 2011 2:57 am
Location: https://www.joomtut.com
Contact:

Re: How to show module only in article view,not in category

Post by jtut » Tue Jan 08, 2013 2:11 am

Code: Select all

<?php if( JRequest::getVar( 'view' ) == 'article' ): ?>
    <jdoc:include type="modules" name="position-xxx" />
<?php endif; ?>
Joomla! support - Joomla! tutorials and more -> https://www.joomtut.com
Steps to creating a Joomla! website with video clip tutorials -> https://www.joomtut.com/joomla-clip

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 41507
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to show module only in article view,not in category

Post by Webdongle » Tue Jan 08, 2013 2:16 am

Easiest way is to not assign the module to any menu item you don't need it. http://extensions.joomla.org/extensions ... ment/10307 may be of use to you.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “Templates for Joomla! 2.5”