Inserting Joomla modules into the material. How to insert any module into Joomla content

Your theme provides positions through which you can make a module output. True, pre-installed modular positions may not be enough, because there are cases when a module needs to be displayed in a specific material and in a certain place.

How to insert a Joomla module into a material

To insert a module for articles in Joomla 3, follow the steps:

  1. Go to "Extension Manager", open the module that you want to insert into the article. For the sake of example, we took the standard “Login Form” module for logging into the site, but you can use any other one;
  2. If you look at the right side of the module, then in the “Position” item you will see its placement (for example, Position-7). You need to delete this position by clicking on the cross located to the right of the name;
  3. Now you need to click on the “Enter or select a position” field, open a new window using the left mouse button and enter the new name of the modular position (numbers and Latin letters are allowed);
  4. After this, you need to save the changes using the “Save and Close” button;
  5. As a result of this, the module that needs to be placed in the material will receive the new name of the position that you came up with;
  6. Now we open the material in the place where we wanted to insert the module and write: (loadposition name_of_your_position);
  7. After that, we simply save the changes in the material and check the operation of the module in the article.

After performing the above-described manipulations, the login/registration form was displayed in the article. Naturally, no one needs it in the material, but another module can be very useful.
https://www.youtube.com/watch?v=1bm4Cg89Dsw

Modules Anywhere: a solution for displaying modules anywhere on a Joomla site

Modules Anywhere is a plugin that allows you to display modules in templates, articles, inside components, plugins, etc. The work of this plugin is very similar to the work of the standard Load Module plugin, but the plugin in question has a large list of real advantages, and can even replace Load Module.

The plugin also comes with the Button Modules Anywhere plugin, which adds a button to the Joomla editor.

Thanks to this solution, you can insert the syntax for calling the module you need directly into the content of the materials. Especially useful if you often need to display modules in Joomla content/articles.

Joomla plugin features:

  • modules can be displayed not only in materials, but also in plugins, template markup, components, etc.;
  • you can display not only the position of modules, but also an individual module, which can also be displayed by ID or name;
  • there is a button for inserting syntax into materials/articles;
  • you can set the module display style;
  • You can completely replace the standard Load Module.

Actually, in order to display one individual module, you need to know its name or ID. You need to write module in curly brackets () and then write the name or ID of the module. It should look something like this: (module ID_or_module_name).

The syntax for displaying a position is the same, only after the word module you must specify a specific position (for example, (module top)). It is also possible to override the default module style. The following styles exist: table, xhtml, none, rounded, horz. It will look like this: (module top|table).

The plugin has very few settings, but there are some important ones. So, in the “Module” tag you can override the module tag being used. You can write any other word here, but do not forget that you will have to use it when displaying modules (for materials and articles). Changing the word can be useful in the event that some of the extensions will throw errors when trying to use the module tag.

And in conclusion: the displayed module must be activated, but if you do not want it to be shown in the standard place of the topic, but only in the material, then you need to remove the position in the module settings. In some cases, the enabled “Ignore Caching” option also helps to avoid errors, which prevents some problems with the CSS and JavaScript of the module used.
https://www.youtube.com/watch?v=BEFKNiG9ygY

CMS Joomla is often called a complex system with complex code and complex template construction. This is actually true and Joomla is somewhat more complicated than WordPress, but much simpler than Drupal. The main thing is to understand which file is responsible for what and how to edit them safely.

Today, I will begin to debunk the complexity of the Joomla code and show you how to quickly and easily add your own, let's call it custom, position for modules anywhere in the template. Moreover this method universal and works on any Joomla template, including templates for an online store.

  • Where to download a Joomla template – 39 real Joomla template authors
  • One-page Joomla templates: purpose, features of use
  • Creating a Joomla template yourself, part 1: template directory, templateDetails.xml and index.php files

Formulation of the problem

To begin with, we set a clear task. It is necessary to add an additional position for modules to the working site template. Ahead of the story, you can add as many of these positions as you need; at the end of the article I will add two.

Instead of a preface

  • Let me remind you that in Joomla 3 you can edit template files on the tab Extensions→Template Manager →Templates.
  • For safe editing, the template file being edited is copied and transferred to text editor and it is edited there. This leaves an original copy of the file in case of unsuccessful editing.
  • And just in case, any code editing should be started with a complete copy of the site at hand.

Solving the problem, add your module position to the Joomla 3 template

For editing we need two working template files: index.php And templateDetails.xml.

Let's go to Extensions→Template Manager. In the “Templates” column, select a working template and click to edit.

On the editor page we look for the file index.php– main template file.

Select the place where we want to paste custom module, and insert the line:

Note: As you can see, the attribute value is not specified in the line style. This means that when creating a module in the menu " Extra options» you can specify any module style from the working template or from styles system.

In the photo you can see that I have set a single style for this sidebar position. Therefore, when creating a module in additional settings indicate “inherited” or “sidebar” of the working template.

class="eliadunit">

At the end of the list with module positions, insert the line:

custom-position

Again, don't forget to save.

Basically everything. We clear the site cache, go to the module manager and create any module in a custom position. The Custom-position appears in the list of positions.

Let's look at the result.

Adding two new positions for modules

For example, I created another position for modules. We do everything the same, only we give the position a different name, for example custom-positionA. I moved this position beyond the forms for adding modules and placed it immediately after the closing tag so that the position appears immediately after the site title.

Let's look at the result.

Now you know how to add your module position to a Joomla 3 template

By the way, when I was making examples for the article, I found viral code on the demo template that successfully deleted I wish the same for you.

Today I’ll tell you about a small Joomla features which, as it turns out, few people know about. This feature allows us to insert (output) any module into the content. That is, display the module anywhere in the material, which sometimes turns out to be very, very useful.

And so let's get down to business. Open any joomla module. I'll take the search module as an example.

We go inside and there we see:

Let's study the "Position" field; this field is intended to display the module in a specific position on the site. In appearance it resembles a regular select, but in reality it is not (for interest, you can inspect the element). Try placing the cursor in this field and erasing or writing something....Surprised? I think yes.

Enter the position in this field new1 picture below:

Now we need to configure and enable the standard plugin if it is not enabled. To do this we follow the following path "Extensions-->Plugin Manager-->Content - Load Module" let's go into it.

There we see:

In the settings, enable the plugin if it is not enabled, and select a style, I usually choose without border.

How to display a module in a Joomla module - 4.3 out of 5 based on 8 votes

Often, to create certain website functionality, you need to display a module in a Joomla module.

There are many options where this can be useful to you and many ways to display one module inside another Joomla module.

In this lesson we will look at many options for module output, I think one of them will definitely be useful to you.

Adding a module position to a module template.

A module inside another module can be displayed by adding the module position to the markup template of a particular module.

Suppose we need to display the position of modules in a menu module. To do this, we need to add special code to the template markup file of this module - default.php.

If your template has a menu module templated, then this file will be located in the following folder: site folder/templates/name of your template/html/mod_menu.

If this file is not found in the specified path, then you need to look for it in the following location: folder with the site/modules/mod_menu/tmpl.

Open this file using an editor (you can use ) and add the following code at the very bottom:

loadRenderer("modules"); $options = array("style" => "xhtml"); $position = "position"; echo $renderer->render($position, $options, null); ?>

Just instead of the word “position”, indicate any module position you need (top, user1, etc.).

Save the file. Now give the specific module the position you specified in the code and it will appear at the bottom of the menu module.

By analogy, you can add a module position to any module or third-party component.

So that in the future, when updating the system, the file we edited is not overwritten and all our changes are not lost, we need to template it. To do this, in the folder with your template, go to the html folder, create a mod_menu folder in it (if you are templating another module, the folder name should be the same as the folder name of this module) and copy the file you edited here.

In addition, you can output separate module by his ID. You can find the module ID in the module manager in the last column of the table, opposite the module you need.

To display a module by ID, you can use the following code:

loadRenderer("module"); $options = array("style" => "raw"); $dbo = JFactory::getDBO(); $dbo->setQuery("SELECT * FROM #__modules WHERE id="specify ID" "); $module = $dbo->loadObject(); $module->params = "heading=2\nlimit=10"; echo $renderer->render($module, $options); ?>

Just remember to replace the words “specify ID” with the module ID.

Outputting a module using the Modules Anywhere plugin.

Using the Modules Anywhere plugin, you can also very easily display a module in a Joomla module. In addition, this plugin allows you to display the module anywhere.

It allows you to display both the position of a module and an individual module.

If you decide to use this plugin for this purpose, do everything by analogy with the above method of displaying a module in a module using code. Only in this case, instead of code, insert the module call syntax.

Outputting a module in a module of arbitrary HTML code using the standard Load Modules plugin.

In some cases, to create certain functionality, you can display any module in a custom HTML code module, which is included in the standard Joomla modules.

It's very simple and you can get by standard means Joomla without resorting to third-party plugins and editing system files. In this case, the module can be displayed using the Load Modules system plugin, which is designed to display modules inside Joomla articles.

To display the position of a module, just insert the following in the visual module editor of an arbitrary HTML code:

Instead of “specify position”, insert the required module position (position-1, user-1, etc.).

joomla insert a module into an article / material

Today we’ll talk about what has happened – how to insert a module into content or how to display a module inside a post or material. Of course, we will talk about joomle.

And first, I’ll explain why I need to display the module inside the material. Everything here is elementary - it’s increasing the functionality of your site on joomla, I’ll give an example. Do you have beautiful gallery, it is quite logical to show this gallery at the end of the post or even in the middle, where it will look more logical in context. But, as you know, each module in Jooml has a position (top, left, right, user1, user2), strictly fixed and specified in the template of your site in the file - (templates/template name/templateDetails.xml). And positions, in turn, do not affect the area of ​​the post/material. Means in the usual way You can’t display a joomla module inside a post... Although...

Some people here will probably remember (loadposition module) This is a function of the standard joomla plugin included by default, it is called - "

Really! After all, using this function you can display a module inside a post. To do this, check if the plugin is enabled

Then inside the post where you need to display the joomla module write (loadposition module)

Where module is the name of the position (top, left, right, user1, user2).

First, you need to go to the settings of the module you need to output and select there (preferably a unique position not occupied by other modules).

It is very important to do this, otherwise inside the post there will be the output of another module occupying same position with the module you need, but you definitely don’t need it.

If you did everything according to the instructions, then the output of the module inside the material should appear.

But, what should you do if OUTPUTING THE MODULE IN THE MATERIAL via (loadposition module) did not work, despite your correct actions?!

Calm! Now they will appear, no, not eggs, but our long-awaited gallery inside our article.

joomla - how to insert a module into a module:

To do this we will resort to a super plugin called Modules Anywhere. Which in translation means modules EVERYWHERE and, admittedly, this is not empty boasting, in fact, with the help of this plugin you can display a module everywhere - inside a post, even inside another module!

Then install it and check that it is enabled!

After that, we open the material for editing, into which we need to insert our long-awaited gallery and at the very bottom of editing the material, you will see a new button - Insert module.

A window will open with all the modules installed on your site. Choose required module, save the post and look at the result.

Congratulations – you have inserted a module inside your Jooml article!

Gentlemen and, of course, ladies, I want to ask you for advice - which is the best projector to buy?!

Nowadays 3D projectors have become very fashionable, but how mature and high-quality is the technology? Because it feels empty marketing ploy, since people like 3D technology in cinema so much (there has been a real boom in it for a long time), then it is necessary to satisfy consumer demands for home moviegoers.

So I’m wondering: is it worth buying these newfangled 3D projectors, or buying yourself a regular high-quality projector?!