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.

 

Recipe for Virtuemart with Joomla version 1.0.15

Recipe for Virtuemart with Joomla version 1.0.15

Hi,

I need to restrict several modules to appear only on my homepage which is also the Virtuemart storefront.

I've consulted the recipe page for Virtuemart and found this:

Code:

if ($option == "com_virtuemart" and JRequest::getVar("page") == null) return 101;

/* (replace 101 with the module number you want
* to display only on the front page of VirtueMart)
*/

but seems it's only written for Joomla version 1.5.

I'm using Joomla 1.0.15 with VM 1.1.14. Can anyone please advise how I would go about adjusting this code please?

Many thanks

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: Recipe for Virtuemart with Joomla version 1.0.15

Can anyone please help ?

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: Recipe for Virtuemart with Joomla version 1.0.15

Hi there,

sorry it took a while... working like crazy on the new MetaTemplate component which is kind of like MetaMod except for Templates. (just for Joomla 1.5, sorry).

Anyway, to convert the above code to Joomla 1.0, I think you could probably do this:

Code:

if ($option == "com_virtuemart" and @$_GET['page'] == null and @$_POST['page'] == null) return 101; 

/* (replace 101 with the module number you want
* to display only on the front page of VirtueMart)
*/

Let us know how you go...

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: Recipe for Virtuemart with Joomla version 1.0.15

Hi Stephen,

Thanks for getting back to me. I'm afraid that hasn't worked for me.

This was my workflow:-

1. Obtained module ID for module to be controlled by metaMod (= 73) & set to unpublished.
2. In metaMod: Entered the code supplied in the PHP field as follows:

Code:

if ($option == "com_virtuemart" and @$_GET['page'] == null and @$_POST['page'] == null) return 73; 

3. metaMod published to right module position.

Results: metaMod debug info appears on all VM pages

MetaMod debug info:
$option: com_virtuemart
$task:
$id:
$Itemid: 26
$timezone: default
now: 1263205567
$language: en-us
$language_code: en
$language_region: us
Including modules: 73

Any idea what I might be doing wrong ?

Many thanks

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: Recipe for Virtuemart with Joomla version 1.0.15

Hi,

a couple of things, ok 3:

1 - the debug output will appear on all pages - that's ok. It's just the modules which it includes which should appear on less pages, according to the rules.
2 - I wonder, do you have "73" in the "Quick Module ID Include" box? If so, remove it. We'll just use the PHP box in this case.
3 - you said that you set module 73 to Unpublished. That's a trick that only works on Joomla 1.5. For Joomla 1.0, you need to either allocate that module to a module position that does not exist on the template, OR set the menu assignment for that module to "none". Unfortunately, on J1.0 the "none" allocation doesn't "stick", so each time you save that module you need to select "none" in the menu assignment before you save it.

I think that will probably get things working for you.
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: Recipe for Virtuemart with Joomla version 1.0.15

Hi Stephen,

Thanks for getting back to me.

1. Thanks for letting me know - I wasn't aware that the debug info outputs on all pages.
2. The Quick Mod ID box was and still is blank
3. Changed as advised: Set the mod to published, assigned to menu item links "None".

Slightly better result. My  mod appears on the homepage as required, but on the browse page I am getting a blank right column (this column should collapse as I don't want any modules to appear here - looking at the source code the following is being output:

<div class="moduletable-metaMod">
                    </div>

No modules appearing but this output is causing the right column not to collapse and my content to not expand to occupy this additional space.

Flypage is outputting correctly though - no module and no empty column.

So almost there ! Do you think this might require some kind of code change, perhaps to exclude metaMod from outputting on the browse page ?

URL for the browse page is

index.php?option=com_virtuemart&page=shop.browse&category_id=32&Itemid=26

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: Recipe for Virtuemart with Joomla version 1.0.15

Hi qme1ster,,

unfortunately, on Joomla 1.0 there's little I can do to help you with the non-collapsing column problem :-(

It may be due to a countModules() [or equivalent] thing, that's counting the empty MetaMod and reserving the extra space for it. Or, it might be the CSS associated with the actual HTML being generated. If it's the latter problem, then there *may* be something you can do with CSS to get around it, but I wouldn't get my hopes up.

It's this combination of problems that led to MetaMod Pro, which is unfortunately for Joomla 1.5 only.

In the past I have managed to put some code into 1.0 templates that pre-renders the module positions, and looks for generated HTML such as the one you quote above, then disables the module if that's all it finds. But this is a custom job that's going to be different for every single template, and you need some good PHP skills to pull it off. I can send you the code I have used in the past if you want to have a go at 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

Re: Recipe for Virtuemart with Joomla version 1.0.15

Thanks Stephen for explaining the possible issue - yes please send me the code, I'd be interested in taking a look.

Best regards

qme1ster
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
Members Online:
0
Guests Online:
164

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