/templates/myowntemplate/index.php
php if... ($this->countModules("position1 or position2 or position3")): ?>
<jdoc:include type="modules" name="position1" style="xhtml" />
<jdoc:include type="modules" name="position2" style="xhtml" />
<jdoc:include type="modules" name="position3" style="xhtml" />
en php
Load my module :-)
Nothing is loaded
Joomla 4
PHP 7.4
Documentation on Joomla that describes that it should work:
https://docs.joomla.org/Customising_the_way_modules_are_displayed
It is not a bug, it is more a question for the forum. And teh question was posted in Facebook too.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-12-03 19:31:59 |
Closed_By | ⇒ | chmst |
Closing this as it is not an issue of Joomla.
Maybe does not looks like a joomla issue but it works in Joomla 3 and not in Joomla 4.
Works in 80 joomla 3 site's :-)
So i can change this on all my sites on the conversion to J4 but i would say it is still a Joomla issue :-)
Not sure why this was closed as it is a documented method to select the modules
It is deprecated feature in Joomla 3
joomla-cms/libraries/src/Document/HtmlDocument.php
Lines 595 to 597 in 648f2f8
and removed in Joomla 4.
You have to use what @infograf768 suggest.
Then the documentation needs to be updated and it needs to be added to the faq f deprecated features
Yeah, usual problem ;)
Thanks for the fast support guys!
I will change my code :-)
yes actually it is a joomla core issue,
Try
$this->countModules('position-4') or $this->countModules('position-7') or $this->countModules('position-5')