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 frontend. Your module should ...
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.