• Resolved netschmiede24

    (@netschmiede24)


    Hi,

    I am looking for a way to open a pod template in a popup. I have the following setting:

    pod name: “artist”
    template name: “profile”

    That template works well if it is called on a separate page. But now I need to it to open in a popup. So I installed PopupMaker. I created a popup and inserted a shortcode like this:

    [pods name="artist" template="profile"]

    PopupMaker works in the way that you get a class (popmake-xxx) for each popup – and you just need to add that class to a link and then the popup will open instead of the link.

    So on the artist page I have a Pods element list widget with this template:

    <a href="" title="{@post_title,esc_attr}" class="popmake-xxx">{@nachname} {@vorname} </a><br />

    This worked well as long as I just had one artist. But now I have added the second one – and of course the pods shortcode will display all the artist profiles, instead of just one.

    So I am trying to find the correct “where” clause to add to the shortcode – and also possibly need to add the ID or post_title somewhere on the artist page into the link, so the ID (or post_title) will be handed over to the shortcode, so the shortcode will only process the template for the relevant artist.

    Within the shortcode I tried

    slug="id"
    slug="{@ID}"
    where="slug='{@ID}'"

    None of this seems to work.

    Could you please help? Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Slug and ID are two different things. One would also need to verify PopupMaker is building the content of the popup within the context of the artist, or pass a URL to PopupMaker so the shortcode knows which artist is being referenced.

    slug="name-of-artist"

    id="123"

    use_current="1" or id="{@ID}" …might work if PopupMaker runs the shortcode when the content is looping, rather when the popup is built. The latter {@ID} variant required define( 'PODS_SHORTCODE_ALLOW_EVALUATE_TAGS', true ); to be set in wp-config.php.

    The main detail is to inspect how and where PopupMaker is executing the shortcode. There is a Remote Content > Post Type Content feature in that plugin’s documentation, but it is marked as experimental and noted to please ask the developer how to use it.

    If the above shortcode arguments do not work as expected, the key question to ask PopupMaker is how to best get an ID of a post into the PopupMaker template for use in the Pods shortcode. Pods provides special magic tags which can load an ID or slug from an URL if the popup is loaded from a different URL, or PopupMaker might have an annotation method for passing information from the click event to the popup, or the popup might be generated within the main loop where global $post is already correct, requiring no special configuration other than use_current="1".

    Thread Starter netschmiede24

    (@netschmiede24)

    OK – since the feature Remote Content is priced as a premium plugin, this is not going to work.

    I managed to write the popup (modal) code myself just with a PODS template, CSS and JS, which works good enough, so I won’t need Popup Maker.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying a pod template in a popup’ is closed to new replies.