Support » Plugin: Popup Maker - Popup for opt-ins, lead gen, & more » shortcodes rendered manually don’t function

  • Resolved hughc

    (@hughc)


    Hi,
    I’m new to the plugin, and I’m not a novice dev, and I’ve struck exactly the same error message as previously reported here. My use case may be different.

    I’m trying to generate both a popup and trigger button on the fly, on a custom template page. The popup is not being inserted in the post-body field in the Editor, but instead I’m using PHP to generate the shortcode tags and then do_shortcode() to render it. Same for the trigger buttons.

    The popup is also not pre-defined in the popup list (and I couldn’t see anywhere in the docs that this was stated as a requirement).

    Trigger shortcode:

    [popup_trigger tag='button' id='new-enquiry']<li><span class="title">9ct</span> - <span class="price">$1,490</span></li>[/popup_trigger]

    Popup shortcode:

    [popup id="new-enquiry" theme_id="3098"][gravityform title='false' description='false' ajax='true' id='1'][/popup]

    Rendering these gives me the buttons, as expected, and I can see the popup, with the gravity form inside it, hidden in the DOM.

    With no other popups present on the page (apart from the one defined by the shortcode), clicking a trigger button does nothing – I assume this is because the plugin is unaware that there’s a popup on screen, and the relevant JS is not loaded? I couldn’t see a documenteed way to manually load it.

    If a pre-defined popup is present in the DOM, with its ID targeted by the trigger buttons, it works. If it has the same ID as the shortcode generated one, then it shows (not the shortcode one).

    But if the button targets the shortcode generated popup only, clicking the button gives the same JS error as previously reported.

    In site.js on line 1182:

    if (settings.mobile_disabled !== undefined && settings.mobile_disabled) {

    settings is undefined which means $popup.popmake(‘getSettings’) is returning nothing.
    I’m stumped. Unsure if I’m outside the bounds of how the shortcodes must be used in order to function.

    PS as an aside, I tried turning on debug, but I get a different console error as the page loads:

    case “click_open”:
       pum_debug.click_trigger(t, o.settings),
       console.log(i.label_cookie, o.settings.cookie.name)
    }

    returns the following JS error:

    cannot read property ‘name’ of undefined

    Seems to me that my popup is not being correctly initialised in some way, that one created in the post editor would be…?

    • This topic was modified 4 years, 8 months ago by hughc. Reason: formatting
Viewing 2 replies - 1 through 2 (of 2 total)
  • @hughc

    Sorry you’re having difficulties, I’m sure we can this resolved.

    I’ll have our Lead Dev @danieliser take a look as soon as possible.

    Thank you for being patient.

    Plugin Author Daniel Iser

    (@danieliser)

    @hughc – Sorry I didn’t reply sooner. I just saw this ticket when trying to clean up old un-closed topics.

    We can force the scripts to load using a constant POPMAKE_FORCE_SCRIPTS.

    I will try debugging the shortcode popups this week and look to patch any missing settings issues. I think you are correct and the shortcode popups got left behind in the last update. Need to fix that for sure.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘shortcodes rendered manually don’t function’ is closed to new replies.