Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » VM categories and not sub categories
VM categories and not sub categories
VM categories and not sub categories
Joomla V1.5.14
Database 5.1.30
PHP 5.2.9
MetaMod 2.2c
i am building a commerce site the requires 4 modules (2 left 2 right) to be active when user is anywhere in Virtuemart.
Below is the example of the left module receipe;
if ($option == "com_virtuemart") {
$category_id = JRequest::getVar("category_id");
$category = JRequest::getVar("category", null);
$page = JRequest::getVar("page");
if ($page == "shop.browse") {
/* when viewing ALL categories */
if ($category === '') return 77; /* module 100 for "ALL" categories */
if ($category === '') return 78; /* module 100 for "ALL" categories */
}
}
The site is http://www.ttmarketingservices.com/zcentre/index.php
When you go to the shop (300ZX) The menu and cart appear on the left (as it should). if you select from the main body, metamod appears to work, If you select a category from the meny, it's OK, but if you select a sub category the modules disappear.
Please advise
jon
12-Feb-10 12:59:07
Re: VM categories and not sub categories
Hi Jellyfish,
I'm looking at the URLs generated when you click on that module...
The top level items give a URL like:
index.php?option=com_virtuemart&page=shop.browse&category_id=6&Itemid=7
The sub-categories have a URL like:
index.php?option=com_virtuemart&page=shop.browse&category_id=2&Itemid=7&Itemid=7
See the difference? By systematically changing the & things to just & in the URL, I see that the module starts to work properly when I replace & to & just before one of the Itemids.
This suggests that Joomla's module system is having trouble detecting the Itemid (not surprising really). The module system relies on this Itemid, which is the ID of the menu item that the component was assigned to. It uses that to know which menu items to "attach" the module to.
So there are 2 things to say:
1 - see if you can get a fix for the category list module, so that it doesn't mess up the outgoing URLs. That's the best fix, because that's what's really at fault.
2 - you can work around this by assigning your MetaMod to ALL pages instead of just the Virtuemart menu items (I assume that's what've done, which is normally best practise). This means that the MetaMod won't care about the Itemid, and should then be active on all the virtuemart pages. HOWEVER you may end up with some problems inside the MetaMod with some variables not being accessible because of the same issue as above... but I dont' know that for sure; you may be ok.
Hope that helps,
Stephen
Re: VM categories and not sub categories
Hi Stephen,
Thanks for that, I have no idea why virtuemart is doing that??
I thought the receipe I was using enabled the modules to display anywhere within VM, however being a bit of a PHP newbie, I'm happy to be corrected!
Best Regards
Jon
Re: VM categories and not sub categories
Yes, the recipe you are using can enable the modules to display anywhere in VM. I was just recommending that you assign the MetaMod to "all" pages, instead of just to your main VM item. This is because due to the bug mentioned earlier, Joomla may not recognise that you are on that particular menu item, so if you have restricted the MetaMod module to only that menu item, then Joomla wouldn't even run the rule inside MetaMod.
The issue with the module is just a bug in that module that you are using. Is it a standard VM module, or something from a 3rd party? Best go back to where you got it from and report the bug.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » VM categories and not sub categories
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 1
- Guests Online:
- 134
- Online:
- uistr4qx
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked