Search
Other Modules Anywhere questions
Forum

Module Anywhere breaks css layout.

Nifa's Avatar Nifa
Dear support,

A component comes with a nice designed module, showing pretty when I put it on a page. Now I have the need to dynamically override a module parameter, so that is why I want to use Module Anywhere.

But, when I created a new custom HTML module with only (no other HTML markup):
{module 319}
The module background is gone and the position of some elements are no longer in the right place. It looks like it doesn't see the component's stylesheets any more.

I also tried:
{module id="319" fixhtml="true"}
{module id="319" fixhtml="false"}

Do you have any clue why Module Anywhere doesn't display the module in the same css-style as the module self?

Met vriendelijke groet 😉, Nico
Peter van Westen's Avatar Peter van Westen ADMIN
Probably the css of your component/template is formed in a way that it is only applied if there are certain patent elements with certain classnames.

For more info about how elements get their styling, you can use the Element Inspector of your browser.

See what the difference is in element structure and classnames with the one that is working.
Please post a rating at the Joomla! Extensions Directory
Nifa's Avatar Nifa
Okay, I had hoped there was a way in Module Anywhere to get the module displayed just the same way as the module 😉
Peter van Westen's Avatar Peter van Westen ADMIN
Normally you can. It all depends on how (special) styling is applied.
Please post a rating at the Joomla! Extensions Directory
Nifa's Avatar Nifa
Hi peter,

A quick, dirty fix was an extra line of code. This works fine for now, it will only have the same stylesheet loaded twice on some (other) pages.
<link href="/media/com_COMPONENTNAME/assets/css/style.css" rel="stylesheet" />
{module 319}

Have a nice day,
Nico
Peter van Westen's Avatar Peter van Westen ADMIN
So there is probably nothing in that module that loads the component stylesheet. So that is really an issue with that module. Not with Modules Anywhere.

If you use the Joomla way to add the stylesheet, it should only load once.
See: docs3.regularlabs.com/sourcerer/the-basi...tyles-and-javascript
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription