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.

 

HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi,

I have two modules (two slideshows) on my Frontpage. Problem is they appear on all my Virtuemart pages. How can force them to appear only on my Frontpage and never on my Virtuemart pages (including Virtuemart Frontpage)?

I'm using latest Joomla, Virtuemart and Metamod versions.

Thank you for your help.

Edited By: IMPACT360
04-Feb-10 10:34:38

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

I have the same question. VirtueMart uses the page varibale, like this: page=account.order_details. It would be great if we could use $page or even better if we could get all variables from the url...

And i hope this all works with sh404SEF turned on?

Thanks for any help with this!

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

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Ohh, I'm so embaressed roll

I didnt search the site before posting. Here is the solution:
http://www.metamodpro.com/support/recip … mart-pages

Regards

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

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Well I tried this but it doesn't work for me at all.

I copied and pasted this into module's php square:

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)
*/

I tried also this one:

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 100; /* module 100 for "ALL" categories */

  /* when browsing a specific category on browse page (e.g. category 2) */
  if ($category_id == "2") return 101; /* module 101 for category 2 */
  if ($category_id == "3") return 102; /* module 102 for category 3 */
  if ($category_id == "4") return 103; /* module 103 for category 4 */

  /* when browsing any other category on browse page */
  return 98;
}
}


But nothing seems to work.

Could anyone help me understand what I'm doing wrong?

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi IMPACT360,

if you don't want the modules to appear on any VM pages at all, I would use a combination of these 2 techniques:

(1) make sure you have the VM component assigned to a menu item, even if that menu item is on a menu that isn't showing anywhere. Then, assign your "front page" modules to every menu item EXCEPT the VM menu item

(2) if that isn't practical (e.g. if you're frequently adding new menu items/pages and you don't want to have to keep going back to those main modules and add those menu items to the list), then you could just place those modules into a MetaMod, assign the MetaMod to ALL pages, and use the following MetaMod PHP rule:

Code:

if ($option != "com_virtuemart") return XXX;

// replace XXX with the module ID of the module you want to display
// on every page that is NOT in the VM component.

Don't forget to follow all the other instructions on the Quick Start page http://www.metamodpro.com/get-started/quick-start

Hope that helps,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi,

Thank you for your answer but it didn't solve the problem. We must be doing something wrong. Only thing method 2 did was to hide the module on every page, and instead of seeing the module we get this message:

Parse error: syntax error, unexpected $end in /homepages/3/d141936901/htdocs/newsaishop/modules/mod_metamod/helper.php(523) : eval()'d code on line 1

We have plugin Metamod Pro 2.1 installed

We want this module to appear ONLY on the frontpage, and for sure not in Virtuemart.

Here's what we did:

1. Opened the module "JA SLIDESHOW", in Menu Assignment section selected the radio button marked “None”.
2. Created a new MetaMod module, called it "MOD JA SLIDESHOW"
3. Gave it the “position” we want it to appear in (JA SLIDESHOW)
4. Set “Published” to Yes
5. Assigned it to all pages Menu item
6. Used the following MetaMod PHP rule: if ($option != "com_virtuemart) return 59;

Thank you for your help.

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi IMPACT360,

when I first posted the reply I made an error in the PHP (I edited the post again after that). Unfortunately you ended up with the wrong version, sorry about that.

It was just a missing end-quote. Try this:

if ($option != "com_virtuemart") return 59;

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

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi Stephen,

Thank you so much for your support. Unfortunately our problem is still not solved.

The error message is gone, but now the frontpage module (JA SLIDESHOW) is back. We would like to be able to assign it to the frontpage only.

If we go to Virtuemart frontpage the module (JA SLIDESHOW) is not there, but if we select a category of product inside Virtuemart, it's back on the top of the page forcing viewer to scroll down to see the products.

Here's the page: http://www.new.saishopweb.com/index.php … p;Itemid=1

Cheers,

Marc

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi Marc,

I think I'm getting a little bit confused about "front page" and "virtuemart front page". Are these the same on your site? They seem to be... http://www.new.saishopweb.com/ seems to be the same page as http://www.new.saishopweb.com/index.php … p;Itemid=1

So I am looking at this page, and some of the inner pages, and I can't see which module is NOT on the front page, but IS on the category pages.

e.g. from the e-boutik menu I choose "SaiWear FEMMES", and I see the same 2 big slideshows that I see on the front page of the site:

...comparing front page http://www.new.saishopweb.com/ with SaiWear FEMMES: http://www.new.saishopweb.com/index.php … p;Itemid=1

Lastly, could you please tell me:
(1) which menu items the MetaMod modules are attached to? (e.g. "all", or "only the virtuemart menu item")
(2) which modules are your target modules? I can't work out if it's the big one at the top, or the slightly smaller one underneath
(3) what PHP rule you are using?

Best regards,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: HIDE FRONTPAGE MODULES IN VIRTUEMART PAGES

Hi Stephen,

Thank you for your time.

Here are answers to your questions:

Quote: "I think I'm getting a little bit confused about "front page" and "virtuemart front page". Are these the same on your site?"

Answer: No they are not the same at all, but Virtuemart is using the frontpage as background. Virtuemart has been assigned to certain menu items.



Quote: "So I am looking at this page, and some of the inner pages, and I can't see which module is NOT on the front page, but IS on the category pages."

Answer: That's the problem, if a module is on the frontpage it's (unfortunately) on the category pages.



Quote:  "(1) which menu items the MetaMod modules are attached to? (e.g. "all", or "only the virtuemart menu item")"

Answer: Here's what we did:

1. Opened the module "JA SLIDESHOW", in Menu Assignment section selected the radio button marked “None”.
2. Created a new MetaMod module, called it "MOD JA SLIDESHOW"
3. Gave it the “position” we want it to appear in (JA SLIDESHOW)
4. Set “Published” to Yes
5. Assigned it to all pages Menu item
6. Used the following MetaMod PHP rule: if ($option != "com_virtuemart") return 59;



Quote: "(2) which modules are your target modules? I can't work out if it's the big one at the top, or the slightly smaller one underneath"

Answer: We first tried to get rid of one slideshow at a time. End of the day we would like to assign both slideshows to website's frontapge only. They are called JA Slideshow (ID 59) and JA Slideshow2 (ID 57)




Quote:"(3) what PHP rule you are using? "

Answer: if ($option != "com_virtuemart") return 59;


Again thank you for your time and help.

Cheers,

Marc

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
4
User Info:
 
Total Users:
4383
Newest User:
kingpen99
Members Online:
0
Guests Online:
132

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