Search
Other Modules Anywhere questions
Forum

ModulesAnywhere not displaying all tyes of modules

Joris Lange's Avatar Joris Lange
Hi Peter,

On one of our sites we use ModulesAnywhere for displaying a login module. I am quite sure that this used to work fine before but it stopped now. After some testing with other modules it seems that the behavior is different with different types of modules. If we change the id of the module to be displayed, some others do work.

Not working:
Joomla user login
Joomla smart search

Working:
Joomla custom html
RSForm form display module

The site is J.5. I have only a slight doubt that it worked in J.3 before and that we may have overlooked testing it in J.5. Anyway, at present, this is the situation.

I should add to this that there is quite a chain of events involved, using ReReplacer to insert into the page both the html for a Bootstrap modal window (inside which the login module should be displayed so there is a placeholder for ModulesAnywhere) and the link to trigger this modal. I cannot see how this could work with some type of modules and not with others - but maybe you can 🙂

Kind regards, Frits
Peter van Westen's Avatar Peter van Westen ADMIN
It is probably due to the system plugin ordering. Try changing the ordering of the plugins in question.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Joris Lange's Avatar Joris Lange
Hi Peter,

Thanks for your reply.

I tried my best, changing the order of the system plugins. My basic assumption is that ReReplacer should come before ModulesAnywhere, as ReReplacer is set to insert the ModulesAnywhere placeholder (like {module id="116"}) in the page. I could not find a system plugin that I would associate with the login module to be inserted, so I did not have many other clues.

I tried putting ReReplacer on top of the list and ModulesAnywhere all the way down, I also tried both at the top of the list; ReReplacer first. And some other (rather random) options as well. Neither attempt seems to help.

Just as an extra check I created a test article and I used ModulesAnywhere to load the login module inside it. This worked ok. Just as our construction with ReReplacer and custom html worked before, at least in J.3.

When viewing the page source created by our construction, I can see that the custom html is always inserted correctly by ReReplacer. And in case of some other types of modules, the module content is inserted as well, embedded within our custom html which creates the modal window.

Unfortunately, with Joomla user login and Joomla smart search modules we see only our html. Not the module content - and not the ModulesAnywhere placeholder either. So it seems ModulesAnywhere does "recognize" the placeholder and tries to render it, but fails.

Kind regards, Frits
Peter van Westen's Avatar Peter van Westen ADMIN
In what type of content is ReReplacer placing the {module} tags? In articles, modules, somewhere else?
Please post a rating at the Joomla! Extensions Directory
Joris Lange's Avatar Joris Lange
Hi Peter,

ReReplacer is placing the content directly in the html of the page, on every page, in a hidden div (display:none) just above the </body> tag. Well, actually, there's another, similar block of code directly above the </body> tag and just above that, the content we are talking about is inserted.

I created a dev copy of the site in which I am trying to solve the issue. In the confidential info I wrote the url of this dev site and also the credentials of a temporary admin login, in case you want to take a closer look.

Frits

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
The admin login doesn't work.
You do not have access to the Administrator section of this site.
Please post a rating at the Joomla! Extensions Directory
Joris Lange's Avatar Joris Lange
Sorry, it should work now.

Frits
Peter van Westen's Avatar Peter van Westen ADMIN
I have no idea why the module is not being output.

Can you also give me (s)ftp access so I can take a deeper look?
Please post a rating at the Joomla! Extensions Directory
Joris Lange's Avatar Joris Lange
Ftp access added.

Frits
Peter van Westen's Avatar Peter van Westen ADMIN
So the reason is this:
The module cannot be placed because the Asset Manager is locked.

In Joomla 4 & 5, when something tries to load scripts or styles after the head section of the page is rendered, it will error out.
The login module tries to load scripts. But Joomla has already rendered the full html.

I advise you to create a module position in your template just above the </body> tag. Then assign the login module to that position.
Or place a custom module there in which you place whatever you want with the {module} tag. Don't forget to enable the Prepare Content option in that module.
Please post a rating at the Joomla! Extensions Directory
Joris Lange's Avatar Joris Lange
Hi Peter,

Thanks for your reply. I'll try to work out a solution as you describe, but I cannnot do that right now. I'll get back to you later - whether I managed to solve it or not.

Have a nice weekend,

Frits
Peter van Westen's Avatar Peter van Westen ADMIN
PS: You already have a module position there you can use: debug
Please post a rating at the Joomla! Extensions Directory
Joris Lange's Avatar Joris Lange
Hi Peter,
[...] place a custom module there in which you place whatever you want with the {module} tag. Don't forget to enable the Prepare Content option in that module.
You already have a module position there you can use: debug

I combined both suggesions, while I assigned the login module itself to a "non-existent" position.

This works fine now.

Thanks for your help!

Frits
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription