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.

 

Virtuemart pagination causing Metamod modules to disappear

Virtuemart pagination causing Metamod modules to disappear

Hi everyone

Got to say as a Virtuemart user this piece of software is a life saver.
Seriously, a BIG life saver (who ever would have thought that Virtuemart couldn't handle modules assigned to VM categories via a menu... WTF?).

OK, I've installed MetaMod Pro 2.6, have Joomla 1.5.22, Virtuemart 1.1.7 and sh404sef 2.2.3.945.

Other than not knowing enough coding (hey, some sort of WYSIWYG interface down the line would be way helpful for some of us) I have found a problem that I hope is able to be fixed.

In the Joomla backend I have limited the amount of items that can be displayed to 10 (either Joomla articles or Virtuemart products).
MetaMod works BRILLIANTLY on the first page but when you click on the pagination (Next) button, the MetaMod modules are not there.

Dumb as I am, I can see that the URL when I click 'next' changes from (as an example) http://www.lovenz.co.nz/Skinfood.html to http://www.lovenz.co.nz/Skinfood.html?l … itstart=10

Could anyone point me in the right direction, is there a recipe for this?
My site is currently in development and offline, I can PM or email the admin details if required.

Also setting the limit higher in the backend is not really an option (thanks)

Also one last question, I had a strange one.
I setup some modules to be displayed on certain categories in Virtuemart and all was working well.
Then I had a rush of blood to the head and purged my sh404sef, cleaned my Joomla cache and for some reasons the item ID referenced in my Metamod modules needed to be changed.
This was noticeable on products that are listed in multiple categories, as a note.

Is this normal?
Also what is the ‘item ID’?

Cheers

Mark

bryantwest
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Virtuemart pagination causing Metamod modules to disappear

Hi Mark,

on the 1st question about pagination: how are you detecting the VM pages? By URL, or using some JomGenius rules, or what? If you can paste the code you're using here I should be able to tell you why the pagination breaks it, and what you can do to fix it.

You might even find it useful to change which modules appear on the 1st page of the pagination, from subsequent pages... up to you.

The Itemid thing:  (tears his hair out...)

Itemids are supposed to refer to the id of the menu item that the component was assigned to. So your front page is by default Itemid 1, and every new menu item you create gets a new id number. Joomla often relies on this id to get more information about how to display the page. i.e. when you set up a menu item you often set some parameters on that page. So the Itemid helps Joomla to get hold of those parameters so it can use them when generating the page.

Now, VirtueMart is a real pain with Itemids. The internal links that it generates often just set the Itemid to 1 or to the Itemid of the 1st VM menu item that it can find. So if you have more than one VM menu item, then links from inside any of the menu items often get sent back to the Itemid of the 1st one. This really confuses module assignment and template assignment, if you have allocated modules/templates to particular menu items.

sh404SEF can make this even worse. I don't know exactly how it does it, but sometimes it goes and caches the wrong Itemid for a certain page.

Back to MetaMod: this can definitely help to get around these problems.

If you have been using MetaMod Advanced Debug mode to create PHP code to identify pages, then this often includes parameters that you don't actually need.

e.g. the Itemid is often not required for VM
e.g. pagination parameters may not be required if you don't want to target the pages to the exact paginated page (perhaps that was the reason for your 1st issue?)

So I'd say just remove the line in the rule that has the Itemid in it, and try again. It will probably work. Likewise for any lines containing "limit" and "limitstart".

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: Virtuemart pagination causing Metamod modules to disappear

Hi Stephen

Thanks for getting back to me so quickly.
I'm no coder so please be warned!
This is the code that I'm using to display the modules:

if (
$option == 'com_virtuemart'
and JRequest::getVar('category_id') == '9'
and $Itemid == '207'
and JRequest::getVar('limitstart') == 0
and JRequest::getVar('lang') == 'en'
) return "143,142,168,130,169,124,145,144,146,141";

Any help is greatly appreciated.

Cheers

Mark

bryantwest
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Virtuemart pagination causing Metamod modules to disappear

ok, you can just knock out some of those lines which are probably unnecessary:

if (
  $option == 'com_virtuemart'
  and JRequest::getVar('category_id') == '9'
) return "143,142,168,130,169,124,145,144,146,141";


You probably don't want it to worry about the "limitstart", nor the language, nor the Itemid. But those possibilities are there if you want to control the module selection based on any of those factors too.

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: Virtuemart pagination causing Metamod modules to disappear

Hmmm... thanks for getting back to me, I updated the code but I'm still having that pagination issue.

I've sent you a PM with the sites Admin details, hope you can help and sorry for the hassle.

bryantwest
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Virtuemart pagination causing Metamod modules to disappear

Update: Mark got it working.

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:
1680
Total Polls:
6
Total Posts:
5914
Total Posts Today:
1
User Info:
 
Total Users:
10831
Newest User:
bluesky1
Members Online:
0
Guests Online:
146

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