2


I'm using Joomla 2.5.7 and want to ask, how I can change a bunch of modules in sidebar, when I change to another Page. An example to clarify my question:

I have 3 Links at the navigation bar:

Events
Shop
Blog

and a Homepage as index.html (logical).

Now, I want display in Events the modules "Where to go" and "About Location" in the sidebar.

In Shop I want to display the modules "About Dealer", "Shipping" and "Images" in the sidebar without the modules "Where to go" and "About location".

In Blog I want to display the module "About Author" in sidebar without the modules above (Where to go, about location...).

So, I know I can do this (or similar):

<?php if ($this->countModules('sidebar-a and sidebar-b and sidebar-c')): ?>
<jdoc:include type="modules" name="sidebar-a" />
<jdoc:include type="modules" name="sidebar-b" />
<jdoc:include type="modules" name="sidebar-c" />
<?php endif; ?>

SIDEBAR-A: "Where to go" and "About Location"
SIDEBAR-B: "About Dealer", "Shipping" and "Images"
SIDEBAR-C: "About Author"

But that is not my plan!

I want just the position "sidebar-a" and that the modules getting hidden (like in countModules) if they are not for this page.
I see this method on the granty framework:

<?php /** Begin Main Body **/ ?>
<?php echo $gantry->displayMainbody 'mainbody','sidebar','standard','standard','standard','standard','standard'); ?>
<?php /** End Main Body **/ ?>

You see just simple code, but with other variables. So very easy in the index.html but this won't work If I do copy and paste ;)(logical)
I don't know how to do it. I do not prefer to get this framework, just for this single sidebar. But there must be a way like this granty framework, but I can't understand the code very well...I'm just an amateur on php. I guess there must be a JavaScript file, which hide and display this diffrent modules.

You can see a live demo here of the single sidebar with lots of modules, which getting hidden and displayed on each page: http://app.ohanah.com/demo-v2/rt/index.php

Have someone an idea how to run this sidebar?

Thanks for reading and helping!

Shaz
  • 2,647
  • 2
  • 35
  • 45
kindisch
  • 766
  • 1
  • 7
  • 23

2 Answers2

1

In the Joomla backend, go to the Module Manager, open the module you want to change, and in the bottom left, you can assign the module to specific pages. This should be what you're looking for and it will save you having to hard code it.

Lodder
  • 19,758
  • 10
  • 59
  • 100
1

You can , for better handling, use the Module Everywhere extension , look for it in JED. It helps you a lot assigning modules not only to menulinks, but even to articles.

Hene
  • 11
  • 1