• Resolved MerelB

    (@mableb)


    Hi,

    I made a template for multiple popups on same page with Pods. Now I also want to close the popup by clicking outside the popup. Therefore I need to use javascript. How can I use the Id selector generated by a Magic tag in Javascript?

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @mableb

    Magic tags are not Javascript and unfortunately cannot not be supported by Javascript.

    The only solution I can think of is to add the info you need as a <script> tag within your Pods templates and add the information in there using magic tags.

    Hope this helps!

    Cheers, Jory

    Thread Starter MerelB

    (@mableb)

    Hallo @keraweb ,

    Thank you for your response. Can you forward a link where I can read more about this? I am not very familiar with Pods Framework yet.

    Thanks in advance!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @mableb

    You use-case would not be documented yet, but you can read more about magic tags here: https://docs.pods.io/displaying-pods/magic-tags/

    Not sure how you could implement this further but you could add some JS vars like this:

    <script>
    var fieldname = '{@field_name}'; // For anything text based.
    var fieldnumber = {@field_number}; // For numeric fields (without quotes).
    </script>

    How this would be implemented exactly will be up to you! I have (for examply) not idea how you have formatted your ID’s.

    Cheers, Jory

    Thread Starter MerelB

    (@mableb)

    I will try this.

    Thanks, Jory!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How to use Magic tag in javascript’ is closed to new replies.