Question

i'm working on a joomla 1.5 for a university project (when it started 2.5 wasn't out :D). What i'm trying to do is to assign a module to my custom component , but not every page of it. The 2 different pages of my component is a page that shows every product , but the other one needs an id to work. In order to assign the module just to a page i think i need to assign every page my component has to a menu item. But my problem is that i don't know how to assign my page that shows a specific product the variable id to make it work.

Was it helpful?

Solution

The Joorthodox way, i guess, would be to control the module availability from the module manager in administator page, where you can assign it to certain pages/menu items only. Thus summarizing, create a menu item type for that page assign it to a menu item which in turn will be your module control switch for that page.

Another approach could be a control directly to the joomla module renderer. An example can be found here: joomla-is-there-a-module-render-plugin-event

OTHER TIPS

One method would be to set the module to be hidden on that page using CSS.

Go to views/view_name/tmpl/default.php and within the tags at the top, add the following code in:

$doc = JFactory::getDocument();
$doc->addStyleDeclaration(" #element_id { display: none; } ");

You will need to inspect the module using a tool such as Firebug, Chrome Dev Tools or another tool depending on which browser you're using, and change element_id to whatever suits your needs.

Hope this helps

Just use Advanced Module Manager and assign your module by URL's not just by the menu link, it works for me to hide and show a module inside the different pages of the same component

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top