• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

Programmatic control of which modules are displayed on a page in Joomla 3.1

I am trying to figure out a way to control which module is displayed in a given position on a given page in Joomla 3.1.  What I want to do is as follows;

Have one module that displays three buttons (labeled A, B, C for the sake of argument), and for these buttons to control which of three other modules (let's call them module 1, module 2, and module 3) is displayed in a different position on the page.

So assuming for sake of argument that the module with the buttons is in position 2 (as defined in the template) and I have another module position defined as position 7 (for example), is there a way for the module displayed in position 7 to be determined by which button is pressed in the module displayed in position 2.

The result would be that if button A is pressed, module 1 would be displayed in position 7, if button B were pressed module 2 would be displayed in position 7, and if button C were pressed, module 3 would be displayed in position 7.

I can think of a way of doing this (I think) by having three separate pages, identical but for the module assigned to position 7, with each button linking to a different page, but that seems an unsophisitcaed way to do things.

I've been digging around online to find something like this but I can't find anything that even points me in the right direction.  It may not be possible but I am not familiar enough with Joomla to figure out whether it is or not.
1 Solution
that's not how Joomla works.
the modules are loaded when the page is displayed - there is also the consideration of the caching side of joomla then the modules you be preloaded.
if you have a page on display and you press a button it cant load a new module it would have to refresh the page and reload the page  with the different module but the modiles are defined  at start up.
your idea of 3 separate pages would be the answer.
gpeaxcelAuthor Commented:
OK Thanks for this perspective.  I had a feeling that this would be the case but had hoped there might be some way to achieve what I was looking for.   Doing it without the need for a page refresh would be good but I can see why that's not feasible the way I was thinking of it.  I will continue to dig around and see if there are other creative approaches I can come up with but in the mean time will go with the three separate pages approach.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now