Exit Modal provides a simple way to display a block as an exit popup modal. When a user makes a move to close the current browser tab, the modal appears. The content of the modal can be text or the contents of another block.

Bounce Convert also allows for the creation of exit popups but is limited to displaying Webforms, whereas this module can display any block content. This includes blocks provided by other modules. An example use-case for this module: placing a Mailchimp list sign-up form in an exit modal. If you're happy to use Webforms and need a some extra functionality, go with Bounce Convert, otherwise Exit Popup provides a quick and simple way to get those conversions!

Installation

  1. Download and unpack the Exit Modal module directory in your modules folder (this will usually be "sites/all/modules/").
  2. Go to "Administer" -> "Modules" and enable the Exit Modal module.

Dependencies

Just Colorbox.

Configuration

The module creates a new block called "Exit Modal" which can be configured through the blocks page: "Structure" -> "Blocks". You can choose to display custom markup or the contents of another block. Place the block just as you would any other block.

You can also display the block in its region as normal by ticking "Also show on page". Triggering the exit modal requires a certain user behaviour, which may not always happen. This option provides a backup.

You can control the appearance of the popup through the Colorbox settings: "Configuration" -> "Media" -> "Colorbox".

Troubleshooting

If the Exit Modal block does not appear, double check the visibility settings for the Exit Modal block. Also check the visibility settings and permissions for the target block, if you are using this option, as they will affect whether the block is displayed too.

Project page

Exit Modal.

Core version

7.x

Git clone command

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/rob.costello/2775329.git exit_modal

Comments

rob.costello created an issue. See original summary.

rob.costello’s picture

Status: Needs work » Needs review
ganesh_kumar’s picture

Hi rob.costello,
Few tweaks are here fix the automated pareview issues too and the issues are listed in the given below url.
Upload the sanbox url from your project
Change the version to work from "Default Branch"
Remove "version" from the ./exit_modal.info file
Remove the license.txt in the module it will updated only by Drupal community

Automated Review

Fix all the Pareview issue listed in the given url http://pareview.sh/pareview/httpsgitdrupalorgsandboxrobcostello2775329git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts
No duplication
Yes: Does not cause module duplication and/or fragmentation
Master Branch
No: Does not follow the guidelines for master branch
Licensing
Yes: Follows the licensing requirements
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template
Code long/complex enough for review
No: Does not follow this module is approval for one time approval guidelines for project length
Secure code
Yes: Meets the security requirements
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Variables which are created for this module should be deleted while uninstalling the module.
  2. (+) It would be good, if you implement hook_help in your module.
  3. Just a recommendation: - Can this module will merged with the module which you have specified(Bounce Convert)

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

rob.costello’s picture

Thanks for your review, Ganesh. I think I've tackled all those issues.

  • Fixed the PAReview JS issues
  • Removed LICENCE.txt
  • Changed the version to work from "Default Branch"
  • Remove "version" from the ./exit_modal.info file
  • Impemented hook_uninstall() to delete created variables
  • Implemented hook_help()

Just a recommendation: - Can this module will merged with the module which you have specified(Bounce Convert)

This module is intended to be a replacement for Bounce Convert for those who require a quick solution and don't need the extra baggage that that module provides.

Thanks,
Rob

arun ak’s picture

Status: Needs review » Needs work

I installed this module. But I couldn't make it work as defined in project page. Please explain more like how and where I can change configurations. Also I am getting following warning after install this module.

Strict warning: Only variables should be passed by reference in exit_modal_content() (line 139 of \sites\all\modules\exit_modal\exit_modal.module).

Also if I am assigning any block which has no scope to the current page(eg: Author Pane) then I am getting below warning message.

Notice: Trying to get property of non-object in exit_modal_content() (line 140 of \sites\all\modules\exit_modal\exit_modal.module).

Thanks,
ARUN AK

rob.costello’s picture

Status: Needs work » Needs review

Thanks for your review Arun,

I've fixed a number of bugs and warnings on the module so hopefully it should be working for you now. I've also added some troubleshooting info in the project page and help. Please let me know how you get on with it.

Thanks,
Rob

arun ak’s picture

This functionality is already available in Bounce Convert module. I am feeling this module only replicating the minimal functionality of Bounce Convert module.

Thanks,
ARUN AK

rob.costello’s picture

Hi Arun,

This module offers functionality that Bounce Convert does not. BC only allows you to place webforms in the modal, whereas this module allows any block content to be displayed. We have had two recent situations which prompted the creation of this module:

  1. We're using the Mailchimp module on our own website. This module provides list signup forms in blocks. We wanted to place one of these in a modal. Achieving this with Bounce Convert would have required custom coding, whereas this module allows you to just drop the block in.
  2. On a client's site, we're using the Fivestar module to ask users to rate content. Again, we wanted this rating request to be displayed in an exit popup. Bounce Convert does not provide a straightforward solution for this.

There are a number of support requests on the Bounce Convert issues queue asking for the functionality that this module could provide: here, here and here. In each case, they're "Won't Fix".

I'm happy to let this one go if there is genuine duplication, but I don't believe this is the case with Bounce Convert.

Thanks,
Rob

arun ak’s picture

Status: Needs review » Needs work

Hi rob.costello,

That sounds great!!! If this module can add user registration and fivestar rating blocks in to exit popup then it will be an additional functionality to the Bounce Convert.

I have done one more round of review and found couple of things.

  1. You should pass default value to the variable_get() function to use value if variable is not set. eg: use variable_get('exit_modal_type', 'text') instead of empty(variable_get('exit_modal_type')) ? 'text' : variable_get('exit_modal_type') in line 48 in exit_modal.module. Fix in all places. Refer variable_get().
  2. Use #attached attribute to include css and js with block.
    $block['content'] = array(
            '#markup' => exit_modal_content(),
            '#attached' => array(
              'css' => array(
                drupal_get_path('module', 'exit_modal') . '/exit_modal.css',
              ),
              'js' => array(
                drupal_get_path('module', 'exit_modal') . '/exit_modal.js',
              ),
            ),
          );
  3. I think we can assign Exit Modal block in to any region to make it work. If that is the case then can we have any alternate method to include exit module popup content in to the page. So that we can avoid the step users to assign Exit Modal block in to some region.

Thanks,
ARUN AK

rob.costello’s picture

Hi Arun,

Thanks for your in-depth feedback. I just got a chance to look at this again.

1. You should pass default value to the variable_get()

Done.

2. Use #attached attribute to include css and js with block.

Done.

3. I think we can assign Exit Modal block in to any region to make it work. If that is the case then can we have any alternate method to include exit module popup content in to the page. So that we can avoid the step users to assign Exit Modal block in to some region.

I agree it's an extra step but using the block interface has some benefits. We can use the block visibility settings to easily hide or show the popup on certain pages and for certain users. In certain cases it may be useful to actually display the block content on the page. E.g. if you have a newsletter signup, mobile users won't see the exit popup as their behaviour won't trigger it, but we can still show the newsletter signup on the page as a fallback. It was simple to do this in CSS, but I've added a checkbox to make this configurable.

You can see this concept in action on our blog. Scroll to the end to see the signup form.

rob.costello’s picture

Status: Needs work » Needs review
mlevasseur’s picture

Status: Needs review » Needs work

Some nitpicking:
README.txt: manually wrap text around 80 characters.

exit_modal.js: include a block comment (/** */) for your behavior defining what the attach function does.

exit_modal.module: inline comments (//) should end with a period.
exit_modal.module: It's better to wrap strings containing apostrophes in double quotes rather than single quotes and having to escape the ', especially in t() strings. (ex. line 99)
exit_modal.module Lines 148, 150, 167: You're forgetting to pass in a default value to variable_get().

Otherwise, good work.

rob.costello’s picture

Status: Needs work » Needs review

Hi Mathew,

Thanks for your feedback. I've made those changes. Also did a thorough bit of user testing, no errors or warnings with any of the various settings. Please let me know if you spot anything else.

Thanks!

arun ak’s picture

Status: Needs review » Reviewed & tested by the community

Hi rob.costello,

I reviewed it again and it seems like you have fixed the issues mentioned in comments. Exit modal functionality is working fine as defined.

I have one suggestion that you can consider in future development, currently the exit modal is activating every time user loads the page. Sometimes it feels annoying to the user. It would be better to have a configuration to setup how many times need to display exit modal popup for a user or a settings to define certain time interval to display exit modal popup.

Otherwise looks good to me and giving RTBC.

Thanks,
ARUN AK

rob.costello’s picture

Issue summary: View changes
rob.costello’s picture

Issue summary: View changes
avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

I will update your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thank you, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks go the dedicated reviewer(s) as well.

rob.costello’s picture

Excellent news. Thanks kiamlaluno and reviewers.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.