Page 1 of 1

How do you hide a module while viewing an article in J1.5???

Posted: Wed Sep 12, 2007 1:41 am
by deeman001
How do you hide a module while viewing an article?  in 1.0.x you could type "if (($option != 'com_content') && ($view != 'article'))" but that doesn't work in 1.5.

Any ideas?

Re: How to Hide Modules while Viewing Articles?

Posted: Wed Sep 12, 2007 6:30 am
by newart
no, I need to know that trick... I hope you can find out your reply in the Coding Forum... but please post here the exact reply! Thank you very much in advance!

Re: How do you hide a module while viewing an article in J1.5???

Posted: Wed Sep 12, 2007 1:55 pm
by Pentacle
$option = JRequest::getVar('option');
$view = JRequest::getVar('view');

I didn't try it and am not sure. But try using these 2 lines before your if statement.

Re: Can You Hide Modules while Viewing Articles in j1.5?

Posted: Wed Sep 12, 2007 2:24 pm
by deeman001
Here is how you do it:

$view = JRequest::getVar('view');

if ($view != 'article') { ?>

[html you do not want displayed goes here]


Re: How do you hide a module while viewing an article in J1.5???

Posted: Wed Sep 12, 2007 2:25 pm
by deeman001
Pentacle,

Thanks for the help.  I modified the if statement just a little and your suggestions worked.

Here is what I ended up with:

$view = JRequest::getVar('view');

if ($view != 'article') { ?>

[html you do not want displayed goes here]



Thanks for helping me out with this.

Re: How to Hide Modules while Viewing Articles?

Posted: Wed Sep 12, 2007 2:28 pm
by deeman001
newart, here is what works.

$view = JRequest::getVar('view');

if ($view != 'article') { ?>

[html you do not want displayed goes here]



This is the way to hide html when viewing an article.

Re: How to Hide Modules while Viewing Articles?

Posted: Wed Sep 12, 2007 3:35 pm
by newart
wow, ok but one question, how to write the URL of that article with that particular ID?

Re: Can You Hide Modules while Viewing Articles in j1.5?

Posted: Wed Sep 12, 2007 4:00 pm
by AmyStephen
Deeman -
Thanks for helping answer questions (for yourself  :P) - but mainly THANKS for documenting your answer for others. That ROCKS!

Amy :)

Edit: PS - You might find Johan's Templates in Joomla! v 1.5 helpful!

Re: How to Hide Modules while Viewing Articles?

Posted: Wed Sep 12, 2007 4:12 pm
by deeman001
for my needs, this will work.  I will continue looking to see if it can be done for each article.  You could probably use the article id # or similar.

Re: How to Hide Modules while Viewing Articles?

Posted: Wed Sep 12, 2007 4:29 pm
by newart
yeah but don't worry it's only a possibility and not a need for my site and so all is ok! Thanx again deeman001. bye

Re: Can You Hide Modules while Viewing Articles in j1.5?

Posted: Wed Sep 12, 2007 6:42 pm
by HarryB
And here is another variation...saves a line of code  ;D


[ html you do not want to display here ]

Re: Can You Hide Modules while Viewing Articles in j1.5?

Posted: Wed Sep 12, 2007 11:18 pm
by pe7er
MOD note @deeman001: Crossposts merged. Please do not crosspost your messages. See the Forum rules: http://forum.joomla.org/index.php/topic,65.0.html

Re: How do you hide a module while viewing an article in J1.5???

Posted: Thu Sep 13, 2007 6:07 am
by newart
another good trick  :)