Showing a Module Inside an Article
Modules are usually associated with menu items, but sometimes youâll want to associate modules with a specific article. Modules are commonly assigned to module positions and these positions appear on the web page as defined in your template.
But sometimes itâs useful to have a module actually âembeddedâ in the article itself and this gives you a great deal of flexibility over where you display your modules. To do so, follow these steps:
Go to ExtensionsâModule Manager and locate the article you want the module to appear in.
Create a new module or open an existing module. Choose the module position you will use for displaying inline in an article. Letâs say âinarticleâ is the name of the new module position weâll use. Click Save.
Go to ContentâArticle Manager and locate the article you want the module to appear in.
Click the article name to open it for editing. Find the place where you want the module to be.
Enter {loadposition myposition} where youâll replace myposition with the name of the module position you used in step 2 (see Figure 9-8). Using the name âinarticleâ from step 2, the code you put in the article would be {loadposition inarticle}.
Figure 9-8. The module tag inserted into an article
Any module assigned to the inarticle position will now load in that article. Check out your results by viewing the article on the ...
Get Using Joomla now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.