virtuapete Posted July 2, 2010 Share Posted July 2, 2010 Hey guys, I have a template that has the ability to switch on and off the display of the com_content on the Joomla homepage based on the template parameters ini file and the fact the homepage uses a variable called 'view'. It is done with the following code: $display_component = !($gantry->get("component-enabled",true)==false && JRequest::getVar('view') == 'frontpage'); My issue is this also affects other components/plugins/modules that also have URL variable's that specify its own "frontpage view", hiding that content as well, which is undesirable. I need to isolate this to the Joomla frontpage *only*. I found an example of someone else addressing this issue, however, the execution was different and with a slightly older version of Joomla 1.5x. That original code for the switch looks like this: <?php if (!($frontpage_component == 'hide' and JRequest::getVar('view') == 'frontpage')): ?> Their solution to this problem using the source above was the following: <?php if (!($frontpage_component == 'hide' and JRequest::getVar('view') == 'frontpage' and JRequest::getVar('option') == 'com_content')): ?> What does the original code I posted at the top look like after it has been modified in order to achieve my desired result similar to the example I have shown? I tried augmenting the code to use the 'option' variable as shown in the example I found, but I am not sure I either wrote the code correctly OR not 100% sure the 'option' variable is the way to do this any longer in the current version of Joomla (1.5.18) I am using. Can someone please help me rewrite the code I included at the top of this post so an additional variable (or something) is included in the statement and ensures that even if there are other pages with URL variables passed elsewhere on the site that use 'view=frontpage', that only the Joomla frontpage is the one affected? Thank you soo much for any help anyone can provide! Quote Link to comment https://forums.phpfreaks.com/topic/206570-using-frontpage-variable-to-refine-template-function/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.