0

I have the facebook like box in a block position and i want to make this block popup for first time visitors only. The popup will open only if the user visits the website for first time and will open once for every visitor.

Is it possible to implement this feature with existing modules? I am not a programmer.

Thank you

  • It will be hard without programming. There are modules for most common functionalities, but when it comes to some more elaborate business conditions, it starts to be hard. After all, programming languages was invented to allow humans easily define conditions for computers to follow ;) You may want to see Rules module. And Colorbox. But I don't know how they play with each other. – Mołot Nov 26 '13 at 8:09
  • Facebook Like is basically an iframe with code from Facebook in it. So what ever happens with the operation and control in that iframe is done by Facebook and not Drupal. It would be difficult to control unless there is setting in the Facebook app itself. – Quentin Campbell Nov 26 '13 at 8:29
  • @QuentinCampbell It's pretty easy to move iframe to lightbox / color box. This part is controlled by Drupal. So it could be relatively easy to code it, for a programmer. – Mołot Nov 26 '13 at 8:33
  • @Molot. True. I thought the popup he refers to are the popup generated by Facebook. As well as whether the user has 'Liked' the page or not before is also from Facebook. – Quentin Campbell Nov 26 '13 at 8:51
  • @QuentinCampbell OP asked to move a whole block into a popup, so I interpreted it as Drupal-side stuff - block is div on a page and can be acted on like any other Drupal-generated div. I agree this question might be a bit clearer about that as there is a room for confusion. – Mołot Nov 26 '13 at 8:54
3

From Comments:

If you want to do a popup for first time visitors, try the Popup announcements or Popup on load modules.

1

This can be done easily if you have a control to find the visitor is first time coming to your site.

Set a persistent cookie once the use visists your site for the first time. Example Set a cookie called persistCookie to true/1. If the user visits for the next time check the cookie (persistCookie) exists/enabled to true. var persistCookie = getCookie("persistCookie");

With a simple condition below you can have a control over the fb like popup,

/* Check the cookie exists in IN your Domain*/
if (persistCookie) {
    /*If cookie exists check the autoopen false*/
    $("#dialog").dialog({
        autoOpen: false
    });
} else {
    /*If cookie exists check the autoopen True*/
    $("#dialog").dialog({
        autoOpen: true
    });
}

Sample Demo listed here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.