Dynamic Content (some feature requests & questions)

Great! Glad to hear you got that working. Thanks for the screenshot and documented flow here! I’m not sure we covered nested loopers in depth in the docs. There will definitely be video tutorials on the subject.

Something worth keeping in mind is that you can also setup a Button as a Consumer, and you can use the Div element as a Provider. With a bit of flexbox positioning this can help avoid too much element nesting if you’re making compact designs.

Now that I think of it, you might even be able to get away with a single headline element that has a Looper Provider and Consumer enabled on it for something like this.

I tried using a single element and provider/consumer and it would not repeat. But I will keep experimenting. It will definitely take some getting used to.

Gotcha, that could happen if the current Provider didn’t have any items, or only one. I realize one challenge is sometimes you don’t have a clear picture of what data is actually being pulled through. Like you can’t visualize in the builder exactly what terms should show up and you might have to go check the backend to verify.

When working with custom post types and other data it might help to prototype designs using the JSON looper, then wire them back up to the real data source later.

For example, if you add a JSON provider and use this:

[
  { "title": "First" },
  { "title": "Second" },
  { "title": "Third" }
]

And somewhere within a Consumer element use {{dc:looper:field key="title"}} you should see “First”, “Second”, “Third” etc. This is a helpful technique to make sure your design looks just how you want it agnostic of data at first.

1 Like