This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I would like to include HTML/Java Script code on a static page but only once every 24 hours (a popup window that points to an event). What would be the best way of doing that with Rainlab's Static Papges?
I would create a component to do this, and register the component as a Snippet (see Static Page docs section Snippets created from components
here: https://octobercms.com/plugin/rainlab-pages#documentation) So that you can programatically show your content whenever you choose to.
The component could inject a Javascript file that would show the Popup when the page loads. Use the addJs()
call in your Component's onRun()
method for this.
ref. https://octobercms.com/docs/plugin/components#component-assets
Last updated
Thanks, Marc. Basically went with your first option and registered the following onStart to the layout's code segment: 'cookieSet' => function ($k, $v, $m) {
Cookie::queue($k, $v, $m);
return Cookie::get($k);
},
'cookieGet' => function ($k) {
return Cookie::get($k);
},
I then can use it directly on the page. Thanks for your support.
Last updated
What do you mean by: "use it directly on the page" ?
Show your code so others can benefit! :)
Hello,
It is possible to show specific content only on a custom date ?
Show some content by days ?
Kind Regard´s
az-vm said:
Hello,
It is possible to show specific content only on a custom date ?
Show some content by days ?
Kind Regard´s
Please don't hijack an existing thread, create a new forum post.
There is this plugin, witch is quite good. You can choose with page popup will show up on, static pages also. Its show popup only ones for the visitor. A quick and dirty solution is to create a new popup campaign for every date. At lest a temporary solution, until you get your own code in place.
Plugin:
1-8 of 8