News:

Support the VirtueMart project and become a member

Main Menu

unable to limit module display to store homepage only

Started by guybr, September 28, 2014, 09:26:11 AM

Previous topic - Next topic

guybr

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]

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

guybr

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...

jjk

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
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations