PricingBlog

How to parse a CMS json content object to toddle elements?

  • basfenix-1277903826069753856

    Bas Fenix

    1 year ago

    I'm working with a CMS API that returns JSON data for content pages. My question is twofold:

    How can I dynamically convert this JSON into Toddle elements?
    Specifically, how do I handle dynamic elements like tables or checklists, that aren't present on every page?
    I understand binding fixed elements (e.g., headers, text) to API responses. But I'm unsure how to approach rendering variable elements that are not fixed on every page but only for a specific page.

    Any insights or best practices would be appreciated!
  • tomthebigtree-1277913886242246728

    Tom Ireland

    1 year ago

    It's absolutely possible, @Bas Fenix . The toddle team use (or did use) Contentful for their blog and render the content in toddle. I received an amazing demo on this when working on a toddle RTE last year (see undefined ). The video I'm referring to is:

    https://www.loom.com/share/f8f6a9f9a74d48388558ad6885414e39
    ❤️1
  • basfenix-1277918792747323392

    Bas Fenix

    1 year ago

    yes, this! 🤯 next Toddle level unlocked. recursive child components, that's new for me! let's dive in
    🙌1