{loadmodule} - do it the right way

Published: 30 December 2013

Probably I missed the documentation somewhere but I struggled to load a specific module within an article. 

One way to do it is to create a module-position like "myPositionThatIsNotUsed" and then you have to use the {loadposition myPositionThatIsNotUsed}. That's woking but why we have {loadmodule ....}? In the documentation you can find that you should use it like this {loadmodule mod_xyz}. But what is when you have a couple of "mod_xyz" modules and you like to show a specific one. In the sense of "hours of debugging can save you minutes of documentation" I did a bit of debugging and found how it works.

The trick is to use the module title. Let us say we have 3 mod_xyz modules titled xyz1, xyz2 and xyz3. We like to use the xyz2 module in an article, that's what we have to write:

{loadmodule mod_xyz,xyz2 }

Yes it is so easy, but isn't anything easy when you know how it works.

You can also add a style, if you don't like to use the standard "none".

{loadmodule mod_xyz,xyz2,xhtml }

Hope that helps others, I am going to add this to the documentation and the source code so that it is easier to find.

All content is licensed as WTFPL. © 2013