A
A
Alexander2016-03-10 16:29:09
PHP
Alexander, 2016-03-10 16:29:09

How to add a module to all pages at once?

There is a cart extension in Joomla, which is inserted like this:
{loadposition blablabla} in the material template.
How to place so that it is displayed on all pages at once, including new ones?
I'm a sucker in Joomla, don't hit me hard

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2016-03-10
@aleksand44

the file responsible for the material template
/templates/your_template/html/com_content/article/default.php
if it is not there, then copy it from
/components/com_content/views/article/tmpl/default.php
Add a full position
<?php $modules = JModuleHelper::getModules('Specify module position');
if ($modules && is_array($modules)) {
foreach ($modules as $module) {
//title
echo $module->title;
//content
echo JModuleHelper::renderModule($module);
};
} ?>
or
PHPSelect code
1
<?php echo JHTML::_('content.prepare', '{loadposition module_position}'); ?>
Don't forget to add to templateDetails.xml in the XML template root directory
Highlight code
1
your_item

S
Sergey Goryachev, 2016-03-25
@webirus

What the f*ck? Either I did not understand something, or some pipets is written above.
Register in the template file and the module will be displayed wherever you tell it.
And you can set the displayed pages through the Module Manager.
And of course, don't forget in templateDetails.xml.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question