Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
<div id="lightboxAutoModal" style="display: none;" rel="lightmodal[|width:480px; height:408px;]">
<div class="lightbox-inner" style="display: inline";> Code for popup which contain a anchor tag <a id="skip" href="/">Skip This Ad »</a>
</div>
</div>
Manage the display of this popup using php cookie - i.e if cookie is not set then it will show the popup box
if (!isset($_COOKIE["welcomead"])) {
//Your popup box code
<div id="lightboxAutoModal".........</div>
//set a cookie "welcomead"
setcookie("welcomead","Ad Viewed", time()+3600, '/', 'example.com');
}
Great solution but in my case with boost reproduce strange behavior when page is cached.. For non-authenticated user cookies is set but pop-up jump again and again.. Do you know where is a problem? To mention, i put php code in block.. Thanks in advance.
Comments
use lightbox and PHP cookie
In the front page write your code for popup -
Manage the display of this popup using php cookie - i.e if cookie is not set then it will show the popup box
For skip the welcomead put this JavaScript -
Great solution but in my case
Great solution but in my case with boost reproduce strange behavior when page is cached.. For non-authenticated user cookies is set but pop-up jump again and again.. Do you know where is a problem? To mention, i put php code in block.. Thanks in advance.