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.

 

Display module based on url

Display module based on url

Hi,

I have a question. I want to dispaly a modul from virtuemart based on URL.
For example: my url is http://www.aresromania.ro/magazin/artic … es-casual.
I want module to show on every page that contains the word camasi in url.
Now i use this:
$vm = JomGenius("virtuemart"); // need this at the start of every rule
echo "Page type is: " . $vm->info("pagetype") . "<br>";
echo $vm->info("category_id");
echo JRequest::getVar("page");
if ( $vm->check("pagetype == category") ) {
  $category_id = $vm->info( "category_id" );
  if ($category_id == "221") return 92;
   if ($category_id == "222") return 92;

}
it's ok but this category camasi has 20 subcategories and i don't want to enter each id every time i need to update.

Is this possible?
Thanks

creativepixel
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Display module based on url

Hi,

I'm not quite sure what you are wanting. If you definitely want it just on every page that has "camasi" in the URL then that's easy. If you want to combine it with other conditions then it's slightly more complex (but still not hard).

To put it on every page with the word camasi in it, try this:

if ($core_genius->check("url contains camasi")) return 92;

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Display module based on url

Hi solved the problem, but now I have another one.
I'm trying to hide some module Login, Who's Online from front page.
Created a new metamod module and published. For the Menu Assignment I chose "On all pages except those selected" and select Frontpage.
In the php section I put the folowing code:
$vm = JomGenius("virtuemart"); // need this at the start of every rule
echo "Page type is: " . $vm->info("pagetype") . "<br>";
if ( $vm->check( "pagetype != frontpage" ) ) return 44;
My module don't show up just if I select in Menu Assignment - On all pages, but then on the front page left column is just empty and content don't strectch over the left column. I want on the front page to have only one column no left and right.

Can you help me ?

creativepixel
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Display module based on url

Hi,

I think you are saying that MetaMod is successfully preventing module 44 from showing on the front page, BUT that on that page the module's position is not "collapsing", and is taking up space.

This is a job for MetaMod Pro - please check the FAQs for an explanation of what is going on.

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
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10778
Newest User:
negina4qx
Members Online:
0
Guests Online:
173

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