Git Product home page Git Product logo

Comments (2)

benlk avatar benlk commented on August 25, 2024

From my understanding of http://blog.apps.npr.org/pym.js/api/pym.js/1.2.0/module-pym.Child.html, the id in every pymChild configuration should be pym_0 for this embed. The id parameter is supposed to match the ID on the parent page, not set it. The ID of the parent doesn't change, so the ID on every child page needs to be set to match the parent. In http://blog.apps.npr.org/pym.js/#example-follow-links, both of the child pages have and id match the ID of the parent iframe.

I'm not sure if there's a way to automatically set the ID of the child to match the ID of the parent element; perhaps you could do this with a small Javascript script and a query parameter ?pym_id=example that is applied to the first child page loaded. The JavaScript would check for the presence of that query parameter, and if it is set, add that query parameter to all the links in the child page. When the link is clicked, the new child page would have the query parameter, so the JavaScript on the new child page would set it as well.

We should probably make a new pym_id parameter on the shortcode that allows end users to configure the ID of the generated embed on the page, but I don't think that's going to fix your problem in this ticket.

from pym-shortcode.

benlk avatar benlk commented on August 25, 2024

@KatieMFritz the next version of the Pym Shortcode will include an id="" attribute that will allow you to set a custom ID on the iframe, to solve this problem: #25

from pym-shortcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.