The Joomla! Forum ™





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
PostPosted: Sun Apr 08, 2007 7:01 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Sep 07, 2005 10:18 pm
Posts: 617
Location: London
???
Can I work out what component is currently displayed in my template as I want to use an if statement to show more of my component and hide some modules if the custom component is showing.. I suppose I could read the url string, but this seems a little clunky to me requiring some string functions etc, and im sure there is a variable available which denotes which component.

_________________
Check out the 'bad toilet' online !


Top
 Profile  
 
PostPosted: Sun Apr 08, 2007 7:57 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
This is easy.  The current component is stored in the $option variable.

So...

Code:
if ($option == 'com_mycomponent') {
...

}


Ian


Top
 Profile  
 
PostPosted: Mon Apr 09, 2007 11:01 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Sep 07, 2005 10:18 pm
Posts: 617
Location: London
Thanks that did it.

SOLVED

_________________
Check out the 'bad toilet' online !


Top
 Profile  
 
PostPosted: Tue Apr 10, 2007 7:59 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Aug 18, 2005 8:55 pm
Posts: 19872
Location: Nijmegen, The Netherlands
Thanks for marking your question as solved!

Could you please mark your first message in this thread as "solved" instead?
(Modify the first message and choose the Message Icon [solved] Image).
This way the list of messages shows that the question has been solved, and other users can benefit from it.

_________________
Kind Regards,
Peter Martin, Global Moderator - Community Leadership Team
http://www.db8.nl - Joomla specialist, Nijmegen, Nederland
Joomla 2.5 multilanguage in 10 steps: http://www.db8.nl/en/joomla-presentatio ... ge-website


Top
 Profile  
 
PostPosted: Mon Dec 06, 2010 11:33 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Nov 19, 2009 7:05 pm
Posts: 29
ianmac wrote:
This is easy.  The current component is stored in the $option variable.

So...

Code:
if ($option == 'com_mycomponent') {
...

}


Ian


Thank you :) Just what I was looking for


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 



Who is online

Users browsing this forum: No registered users and 4 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