Jump to content

Recommended Posts

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!

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.