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

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
deeman001
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 19, 2006 8:25 pm
Location: Austin, Tx
Contact:

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

Post by deeman001 » Wed Sep 12, 2007 1:41 am

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?

User avatar
newart
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 216
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: How to Hide Modules while Viewing Articles?

Post by newart » Wed Sep 12, 2007 6:30 am

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!
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com

User avatar
Pentacle
Joomla! Intern
Joomla! Intern
Posts: 61
Joined: Wed Oct 25, 2006 12:34 pm
Location: Turkey

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

Post by Pentacle » Wed Sep 12, 2007 1:55 pm

$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.
My Joomla! 1.5 extensions - http://joomla.ercan.us
Progress is made by lazy men looking for easier ways to do things.

User avatar
deeman001
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 19, 2006 8:25 pm
Location: Austin, Tx
Contact:

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

Post by deeman001 » Wed Sep 12, 2007 2:24 pm

Here is how you do it:

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

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

[html you do not want displayed goes here]


User avatar
deeman001
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 19, 2006 8:25 pm
Location: Austin, Tx
Contact:

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

Post by deeman001 » Wed Sep 12, 2007 2:25 pm

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.

User avatar
deeman001
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 19, 2006 8:25 pm
Location: Austin, Tx
Contact:

Re: How to Hide Modules while Viewing Articles?

Post by deeman001 » Wed Sep 12, 2007 2:28 pm

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.

User avatar
newart
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 216
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: How to Hide Modules while Viewing Articles?

Post by newart » Wed Sep 12, 2007 3:35 pm

wow, ok but one question, how to write the URL of that article with that particular ID?
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com

User avatar
AmyStephen
Joomla! Guru
Joomla! Guru
Posts: 579
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

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

Post by AmyStephen » Wed Sep 12, 2007 4:00 pm

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!
Last edited by AmyStephen on Wed Sep 12, 2007 4:03 pm, edited 1 time in total.
~*~ Joomla!'s Queen of the Blues - Jennifer Marriott ~*~
http://OpenSourceCommunity.org/node/1719/

User avatar
deeman001
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 19, 2006 8:25 pm
Location: Austin, Tx
Contact:

Re: How to Hide Modules while Viewing Articles?

Post by deeman001 » Wed Sep 12, 2007 4:12 pm

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.

User avatar
newart
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 216
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: How to Hide Modules while Viewing Articles?

Post by newart » Wed Sep 12, 2007 4:29 pm

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
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com

User avatar
HarryB
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Wed Aug 17, 2005 10:30 pm
Location: Vienna, VA US

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

Post by HarryB » Wed Sep 12, 2007 6:42 pm

And here is another variation...saves a line of code  ;D


[ html you do not want to display here ]
If you need a helping hand, use the one at the end of your own arm.
www.hrpr.com

User avatar
pe7er
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 162
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, The Netherlands
Contact:

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

Post by pe7er » Wed Sep 12, 2007 11:18 pm

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
Kind Regards,
Peter Martin (aka pe7er)
db8.nl - Joomla! implementation, programming, template and component development [Dutch]
>> Questions? Get help more easily with JTS-post Assistant: viewtopic.php?f=428&t=272481

User avatar
newart
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 216
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

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

Post by newart » Thu Sep 13, 2007 6:07 am

another good trick  :)
former Q&T WorkGroup Joomla member - Italian Translation Team Member
http://www.eon-project.com


Post Reply