Joomla
Joomla Tips and Tricks
#10 - Load module positions mambot
|
|
#10 - Load module positions mambotDid you know it is possible to actually load a module directly in your content? E.g. We want to load our Featured Articles module in an article rather than in a module position. We can do this using the Load Module Position default Joomla mambot. Edit: See bottom for a new way of doing this, using a 3rd party module though The Load Module positions mambot allows us to load any mambot position as a mambot. Therefore to load the module in a content article we can use the following workaround.
Below is an example of usage of this module. We are loading the Featured Articles Module in the content of this article:
Featured ArticlesAnother good example of usage of this module is this. You want to create an advert (or affiliate link), but instead of copying and pasting the code, you want to be able to replicate this advert at will in your content items. Therefore you use the mod_html module to create the advert you need. Now, each time you want to display this advert, you just insert the { mosloadposition xxxx } (be sure to remove extra spaces before mosloadpostion and after xxxx, spaces were added intentionally in this example) in the content. The good thing about this is that if you want to change the advert, you only need to change this in the module rather than in every content item. Edit: There is a cool module which allows you to avoid all the hassle above. Amongst various functions it allows you to use code as follows to do the above in a much simpler manner: {mosmodule modulename} and the module is immediately loaded.
|
||||||||||||||||||||||||||||||