Search
Other Modals questions
Forum

Module show once

Cathy GAULIARD's Avatar Cathy GAULIARD
Hello

On Joomla 4, I try to open a modal without a link displaying a module just once. Must be seen when the module is published, not seen when module isn't published. So I insert this code directly in my theme :
{modal content="mycustompopup" open="once"}{/modal}
{modalcontent mycustompopup}
{loadmoduleid 217}
{loadposition custompopup}
{/modalcontent}

Bu it doesn't show the text of my module, I see that (as you see I try loadposition and load module it's the same result) :
https://1drv.ms/i/s!Ao_ahcfnOc5QjswoLXRWT-hrNz4SZQ?e=VZPbgNhttps://

Thanks for your help
Peter van Westen's Avatar Peter van Westen ADMIN
You can't use Joomla's loadposition/loadmodule plugins in your template files.

Try Modules Anywhere:
regularlabs.com/modulesanywhere
Please post a rating at the Joomla! Extensions Directory
Cathy GAULIARD's Avatar Cathy GAULIARD
It worked on my Joomla 3 website with this code (without loadposition/module) :
<?php if ($this['widgets']->count('custompopup')) : ?>
    {modal content="mycustompopupmodule" open="once"}{/modal}
	{modalcontent mycustompopupmodule}
        <?php echo $this['widgets']->render('custompopup'); ?>
	{/modalcontent}

But in Joomla 4, I have a php error for render.
Peter van Westen's Avatar Peter van Westen ADMIN
This has nothing to do with Modals. The Joomla plugins are not working in your theme.
Modals is working fine.

You can make it work if you use Modules Anywhere instead of the core Joomla module plugins.

If you don't want to do that, ask your theme/template developers for help on your issue.
Please post a rating at the Joomla! Extensions Directory
Cathy GAULIARD's Avatar Cathy GAULIARD
ok thanks
Cathy GAULIARD's Avatar Cathy GAULIARD
I found another way.
Could you please explain the difference between : Website (Cookies), Page (Cookies), Website (Session) ?
And where can I change the css : the black background color of the popup is so strong.
Thanks
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription