Como você coloca um módulo dentro de um artigo?

From Joomla! Documentation

Revision as of 14:07, 28 July 2022 by Gkiyoshinishimoto (talk | contribs) (Created page with "#Atribua o módulo a '''todos''' os itens de menus. Isso garantirá que ele sempre apareça, não importa como o visitante chegou ao artigo. O módulo não será exibido a men...")
Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français • ‎português do Brasil • ‎中文(台灣)‎
Joomla! 
≥ 2.5
series

Você geralmente desejará associar módulos a artigos de alguma forma. Os módulos são alocados nas posições de módulos e as posições de módulos aparecem em algum lugar na página web conforme determinado pelo tema. No entanto, às vezes é útil ter um módulo realmente incorporado no artigo. O núcleo do Joomla! oferece três maneiras de fazer isso: loadposition, loadmodule e loadmoduleid. O plugin "Conteúdo - Carregar módulos" deve estar habilitado.

Sintaxe:

  • {loadposition position,[style]}
  • {loadmodule mod_type,the title,[style]}
  • {loadmoduleid moduleId}

loadposition

Para inserir um módulo dentro de um artigo, você publica o módulo em uma posição e carrega essa posição no artigo da seguinte forma:

  1. Crie um módulo e defina sua posição para minha posição. minha posição pode ser qualquer valor que não entre em conflito com uma posição do tema existente. Digite a posição minha posição e pressione enter em vez de selecioná-la na lista suspensa.
  2. Atribua o módulo a todos os itens de menus. Isso garantirá que ele sempre apareça, não importa como o visitante chegou ao artigo. O módulo não será exibido a menos que você coloque o comando para carregar o módulo em um artigo.
  3. Edite os artigos onde deseja que este módulo apareça e insira o texto {loadposition minha posição} no artigo, no local onde deseja o módulo.

loadmodule

An alternative to "{loadposition xx}" is the "{loadmodule yyy}" variation which is handled by the same plugin.

In this case the plugin looks for the first module who's type matches the string 'yyy'. So you could load a "mod_login" module by placing {loadmodule login} in your text. If you wish to load a specific instance of a module, because you have more than one login module e.g. titled as Login 1, Login 2, etc. you have to use {loadmodule mod_modType, modTitle} where mod_modType would be mod_login and modTitle is name/title given to your instance of that module. So in the example above you end up with {loadmodule mod_login Login 2}. You can also add the style that is used for rendering the module. To do so, add the style as the third parameter like {loadmodule login,login2,xhtml}. If you don't add a style, then "none" is used.

loadmoduleid

Since Joomla! version 3.9.0 an alternative to {loadposition xx} and {loadmodule yyy} is the variation {loadmoduleid z} which is handled by the same plugin.

In this case the plugin looks for the module who's id matches the number z. So you could load the module with id 200 by placing {loadmoduleid 200} in your text. This variant does not "understand" additional parameters like the style parameter.

Editor Button (since Joomla! version 3.5)

If the editor-xtd plugin "Button - Module" is activated you can use the editor button "Module" to insert above described tags more easily into the editor text. Since Joomla! 3.9 also the loadmouleid variant.

Modules within Modules

It is possible in Joomla! 2.5+ and Joomla! 3.x+ to include a module within a "Custom HTML" module. They are processed by content plugins in the same way as articles.

To make this work, the option Prepare content must be enabled as shown in this screenshot.

Showing the Prepare Content option in a Custom HTML module.

You should remember when doing this that you might experience formatting issues as the "chrome" of the "Custom HTML" module will surround the "chrome" of the included module potential having undesirable effects of the formatting or layout. That's the reason why the "Module" editor button is not available in modules of type "Custom".