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  [ 5 posts ] 
Author Message
PostPosted: Sat May 03, 2008 2:21 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 22, 2005 11:06 pm
Posts: 48
Location: New Zealand
Hi Folks,
I have a module I only want to display if the user is looking at the home page.
Now I managed to sort of do what I want by setting the module to only load for the "mainmenu: home" location in the "Menu Item Link(s): " in the module set up.

But this does not prevent the module for loading when a 404 error is generated, and when the register and login pages are loaded. All of these seem to utilise the "homepage" so the module loads in these instances. I need it to load ONLY when on the actual homepage as if the user just came to the site or has clicked a HOMEPAGE link on the site.

Is there any way I can test for this and then use some sort of IF statement in the template to not display that POSITION I have set up specifically for this module... or even better, to just keep the position there (as I may want other things to display there at some point) but to prevent the module for loading when it's the actual homepage?

With thanks,

Jonathan

_________________
The next re-volution is a global one...
It's exact form I can not predict...
One thing I know for sure... it shall be... A revolution in consciousness.


Last edited by inspired333 on Sun May 04, 2008 6:34 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat May 03, 2008 3:01 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 22, 2005 11:06 pm
Posts: 48
Location: New Zealand
Okay... managed to figure this one out.

Achieved it by using this:

$here = $currentpage = $_SERVER['REQUEST_URI'];
//echo $here;
if ( $here == "/" or $here == "/index.php?option=com_frontpage&Itemid=1" or $here == "/index.php")
{
if (mosCountModules('boxmenu')>0) mosLoadModules('boxmenu',0);
//designate tech.php#tech02 as currentlink
}
?>

Perhaps this'll help someone else wanting to do something similar.

Regards,
Jonathan

_________________
The next re-volution is a global one...
It's exact form I can not predict...
One thing I know for sure... it shall be... A revolution in consciousness.


Top
 Profile  
 
PostPosted: Mon May 19, 2008 3:52 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jun 20, 2006 10:05 pm
Posts: 33
I am using Joomla! 1.0.15 with rocketheme catalyst. There is a module assigned to the frontpage only( assigned mainmenu:home). But it shows up also in registration page and lost password page as well as ads from ads manager "latest ads" module.

I think this is the same issue you describe. I would like to try your fix. Which file did you add this code to?

Thank you for your help.


Top
 Profile  
 
PostPosted: Wed Dec 09, 2009 6:36 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Nov 14, 2008 4:58 am
Posts: 110
where was this code added??

_________________
iPad Case, iPad Screen Protector, and other iPad Accessories...

http://www.ipadaccessoriesinc.com


Top
 Profile  
 
PostPosted: Sun Mar 04, 2012 11:10 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Aug 19, 2011 4:23 am
Posts: 2
This problem is Solved here on this page with a VERY simple solution that doesn't require hacking code or changing any core code

http://www.joomlabamboo.com/blog/tutori ... emid-issue


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



Who is online

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