Hi!

Thanks for the great module.

Can you explain how to display a particular popup via Rules? Does the popup-onload action allow this?

Thanks
Geoffrey

Comments

jordan8037310’s picture

yes, this is rather confusing as I'm not sure what to set for the data selectors for both the conditions and actions for this module. Subscribing.

TechnoTim2010’s picture

Hi

I got this to work and the solution was surprisingly simple. Assuming you know which popup on load content you want, then the popup is an entity and as such has an entity_id.

  1. You can find this from admin-content-popup on loads and hover over the edit link. The entity id is revealed to you in all it's numeric glory. In my case 2
  2. Now go to your rule.
  3. Add any conditions
  4. Add an action "Fetch Entity by ID"
  5. Choose Pop up on Load as Entity Type
  6. input 2 as the value to search for.
  7. Now you have a variable exposed to rules with the entity ID of your popup called entity_fetched (you can of course change this)
  8. So add action "Display a Popup" and it should default to the variable
  9. Save your rule and test, it certainly works for me.

Happy Drupalling

Tim

TechnoTim2010’s picture

Damn, when I remove the rule "Display a popup on page load" from the equation (as I don't want the rule to work on any page load) It does not work anymore.

Digging deeper.

I am aware that this is not what it was originally intended for, i.e. show a popup based on some rules event (in this case "add a product to a cart" but I need it for two situations one to show the popup when accessing a page (on page_load) and also to show the popup when the "Add a Product to Cart" event triggers.

Will suss how this works and if there is a workaround.

Tim

d.novikov’s picture

FileSize
8.89 KB

Hey guys, did you try to set "Disable normal popup processing" checkbox at admin/config/user-interface/popup_onload?

TechnoTim2010’s picture

Yes and I am not getting anywhere with this.

The onload works irrespective of if you check
" Disable normal popup processing
If set, popup_onload module will stay enabled, but popup display will be invoked only as a Rules module action."

It seems to call the onload process (based on the paths you declare in the UI in admin-userinterface-popup_onload), so if you enter in a path other than the path of the page you want rules to show the popup on (the rules target as it were), the popup fails to load on the event, if you make the path that of your rules target(s) it loads when the page loads AND loads when the rule is run.

So if you check that and
Have no paths - it runs on every page load
Have a path other than one the rules event runs on - it fails to run
Have the path that the rules event runs on - it runs on loading the page AND when the event runs.

Does that make sense?

Tim

jordan8037310’s picture

Yes, after my own testing it seems that this implementation isn't sophisticated enough to be triggered by events other than the base event, "Display a popup on page load". Currently having our developers take a look at cost / effort to extend this functionality to a true rules implementation, triggered by any event.

TechnoTim2010’s picture

Hi

I found another solution for a popup based on the "Add to Cart Event" the solution was via the module nice_messages.

This is a great module in principle, it fulfils a need but only in a limited use case.

Keep up the good work.

Regards

Tim

Dor@’s picture

Hi, I do not get it: does #2 require Popup On Load Display? Which also requiers Features(not mentioned in the module page)

ivnish’s picture

Status: Active » Closed (works as designed)