Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

issue with string to identify page

issue with string to identify page

Hi,

under MetaMd 3.9, i'm trying to display a particula module only when a certain component, control and task are set.
for example, if i want my module to be displayed only when:
index.php?option=com_hikashop&ctrl=product&task=show&cid=1&name=deep-blue&Itemid=404
or index.php?option=com_hikashop&ctrl=product&task=show&cid=3&name=red-events&Itemid=404

i write the following thing:

Code:


if(
$option == 'com_hikashop'
and $ctrl == 'product'
and $task == 'show'
)
return 198;

when i do that my module is still hidden
to show it i must remove the part:

Code:

 and $ctrl == 'product'

and $task == 'show'

but in this case, as soon as i'm on the component = hikashop, my module is displayed and this is not correct.

so where is my mistake ?
thx.

rafnews
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: issue with string to identify page

ok i found...
i solved it like that:

Code:

if ($option == 'com_hikashop')

{
$controle = JRequest::getVar('ctrl');
$tache = JRequest::getVar('task');

if ($controle == 'product' and $tache == 'show')
{
  return 198;
}
}

rafnews
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: issue with string to identify page

Yes, that's exactly right. MetaMod automatically populates variables $option, $view and $id, but any others you use from the URL need to be obtained from JRequest.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: issue with string to identify page

I am having the opposite issue. I will like to show modules on all items but the Hikashop checkout pages for they takes up to much room on the right. There is one module that will be on all pages including checkout which is module 74 but the modules 50,46 which are all pages i need not to show on the check out pages...

http://www.mysite.com/index.php?option= … ;Itemid=74

is url example of checkout page- item id is an actual product id

Debug gives me this:

if (
$option == 'com_hikashop'
and $view == 'checkout'
and $Itemid == '74'
and JRequest::getVar('layout') == 'step' /*!*/
and JRequest::getVar('hikashop_front_end_main') == 0 /*!*/
and JRequest::getVar('ctrl') == 'checkout'
) return XXX; /* replace XXX with the module ID or position to display */

MetaMod debug info:
Module ID: 92
$option: com_hikashop
$view: checkout
$id:
$Itemid: 74
$timezone: Etc/GMT+5
$language: en-us
$language_code: en
$language_region: us

Parse error: syntax error, unexpected '{' in /home/blingout/public_html/modules/mod_metamod/helper.php(606) : eval()'d code on line 2
Including modules: None


Please advise what I am doing wrong here - using Metamod Pro

tclarke
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: issue with string to identify page

Hi tclarke,

sorry I lost track of this forum topic... if you're still having trouble with this, can you please post the code from the PHP box? It's just a PHP syntax error as seen in the error message: it's coming across a "{" character when it doesn't expect one. Perhaps you didn't have enough ")" characters in the "if" statement before it?

Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1681
Total Polls:
6
Total Posts:
5912
Posts this week:
6
User Info:
 
Total Users:
11501
Newest User:
riley58745
Members Online:
0
Guests Online:
144

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked