For instance, if I have a position called 'position-1' and I've multiple modules in position-1. How can I get all module names based on position (in this case 'position-1')? Is it even possible? If so, how?


If you mean programatically, JModuleHelper should return the info you need.

$modules = JModuleHelper::getModules('position-1');
| improve this answer | |
  • What I get is - img.exs.lv/e/z/ezeliitis/Untitled_4.png Shouldn't I fetch two objects instead of only one? – Poo123 Mar 27 '17 at 11:46
  • It should return an array of all the modules in that position. I've tested it both on a template and a module. Curious that the object it returns for you has an ID of 0 when they usually start at 1? Are you creating/assigning modules via the module manager? – RichardB Mar 27 '17 at 11:55
  • No, I do it like this: <jdoc:include type="modules" name="position-3" style="xhtml" /> – Poo123 Mar 27 '17 at 12:08
  • How are you assigning modules to that position, though? You seem to have a module position and a module which are both called position-3 - there may just be conflicts in your naming. – RichardB Mar 27 '17 at 12:20

If you wish to know which modules are assigned to a specific template position, simple go to Extensions->Modules, then click Search Tools and then specifie the disired position in the Select Position select box. Hope that's what you are looking for.

| improve this answer | |
  • Not exactly. I want to do it through program code (Using PHP). I have custom template (maybe this makes things clear). I thought Joomla have some way to get module parameters (in this case name/title) of specific position. – Poo123 Mar 27 '17 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.