Hello,
Super module, I love it!
It would also be pretty cool to be able to combine the "Visit Counts" with a minimum time delay before the popup is shown again.
Issue fork simple_popup_blocks-2979803
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ameer khan commentedHi steveoriol,
Thanks for using this module. I checked again the combined features of "Visit Counts" & "delay popup". The popup is correctly showing on particular visit's count after the specified time delay. Kindly let us know if the issue exists in your side.
Thank you.
Comment #3
steveoriolHello Ameer Khan,
I do not want to talk about the "delay" of the appearance of popup after the page is finished charging, it works already well.
But I wanted to talk about a delay in which the popup is not displayed.
Example, for 30 minutes, 1 hour or a few hours or even 1 day and more.
The user could only see once per hour or days (delay to specify in configuration) the popup even if it reloads the page full of times ;-)
Comment #4
ameer khan commentedsteveoriol,
Thanks for the new idea. We will try to implement it on future releases.
Comment #5
steveoriolHello Ameer Khan,
I think it would be great to be able to choose the lifetime of the cookie in seconds in the configuration page of each popup to be able to send it as a parameter in the JS function "createCookie" inside the file "/js/simple_popup_blocks.js":
what coud be:
and inside the popup form setting:
For the moment, it is a fixed value that correspond to 100 days.
I'm not great at coding, so I think I'm gonna patch your js file for my current need which is a 2 hours for the cookies lifetime.
Thanks again for this module, it is TOP ;-)
Comment #6
steveoriolHello Ameer Khan,
finally I developed the functionality, it was not as easy as I thought because cookies can not be changed but replaced, and it is not possible to recover the expiry date of a cookie ...
So I use a other cookie to store this date.
Here is the patch for enabling the feature. I add in DB the field "cookie_life_time" so think well to make a "drush updb" for the change to be taken into account.
Comment #7
alexiscott commented#6 works well for me. Thanks for your work on this, steveoriol
Comment #8
alexiscott commentedWe have been using this patch on a production website. We ran into an issue on IE11 which does not support ES6. As a result, IE11 throws a console error, and breaks other JS on the page. A change to the patch like this will fix it:
Comment #9
steveoriolHere is the updated patch
Comment #10
steveoriolComment #11
christian_m commentedI am working on a similar idea. But in my case, I only want the cookie to expire after a (configurable) number of days. Or when the browser closes. Essentially, I just need to control the expiry date when the cookie is first set. Not sure if this should be a separate issue but I will post a patch shortly.
Comment #12
christian_m commentedHere is my suggested patch. It doesn't use a separate cookie but simply sets the expiry time according to the configured value:
- 0, set a session-only cookie. The cookie is deleted when the browser closes.
- Any integer value, number of days before the cookie is deleted from the browser and the popup re-appears.
Comment #13
janvonmulert commentedPatch from #12 works for me after rerolling for 8.x-2.x dev branch.
Comment #15
mattbloomfield commentedThanks, the patch from #12 has been committed.
Comment #16
mattbloomfield commentedComment #18
antonio.bertolini commentedHi,
thers's a probleme at line 341:
document.cookie = name + '=' + value + expires + '; path=/'
cookie is not added. Instead if I use:
document.cookie = name + '=' + value + ';' // + expires + '; path=/'
(avoid cookie expiry)
all works fine...
I find this:
https://stackoverflow.com/questions/6774848/why-document-cookie-is-not-w...