VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: guybr on September 28, 2014, 09:26:11 AM

Title: unable to limit module display to store homepage only
Post by: guybr on September 28, 2014, 09:26:11 AM
Hi, I'm posting this question here because this issue comes up specifically when I try to display modules (any modules) just on the store homepage: when I select to display only on selected pages and I select the store homepage menu link name (from the options displayed) the module/s display on all VM pages.

I've gone through this a number of times with different [product display] modules without success. Is there something VM-specific that I need to do to limit a module's display *only* to the store homepage?

I have VM installed in a subdirectory on my site (only that section runs on Joomla) - could that be causing the problem?

---
Followup question: how can a module be displayed just on category pages (or a specific category page)? At the moment, those pages don't appear in the tabs I have in the attachment below...

[attachment cleanup by admin]
Title: Re: unable to limit module display to store homepage only
Post by: GJC Web Design on September 28, 2014, 11:16:27 AM
The problem is selecting that menu (if it is the std VM home page) is going to show on all VM pages - it's a joomla thing

either use e.g. http://www.nonumber.nl/extensions/advancedmodulemanager  (paid I think)  or I just surround the module position in the template

with (assuming your site homepage is the VM homepage)


<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
?>
        MODULE code comes in here
<?php } ?>

basically if your not on the home page show the module

If not you need to detect the url and do some logic  e.g. $vmhome = JRequest::getVar('view');
if($view == 'virtuemart'){  blah blah

same applies to category views
Title: Re: unable to limit module display to store homepage only
Post by: jenkinhill on September 28, 2014, 11:17:05 AM
I use Metamod to give better control over module assignments: http://www.metamodpro.com/metamod/metamod-pro

Also see http://www.kaizenmediaworks.com/virtuemart-template-and-module-control
Title: Re: unable to limit module display to store homepage only
Post by: guybr on September 28, 2014, 11:28:18 AM
Thank you both!

I did try Metamod before posting and ironically it too didn't solve the problem but I was using the free version - does that matter? May have answered my own question: probably "yes" because the free version only changes parameters of modules returned from php rules...
Title: Re: unable to limit module display to store homepage only
Post by: jjk on September 28, 2014, 14:24:00 PM
Just an additional note: Joomla module assignment is related to menu items. If you don't have a menu for all your (VM shop) categories, Joomla gets confused with where to display the modules.
Recommended reading: http://magazine.joomla.org/issues/issue-mar-2014/item/1790-using-hidden-menus