Hey Jason, thanks for that tip. Conceptually, that makes sense and I’ll give it a go. I’ll comeback to the topic and mark it as a solution with some steps for anyone else that may need to do this if it works out.
On another note, you mentioned performance, and I believe I am hitting some difficulties with how I’m implementing my app in general that are already affecting page load speeds. Apologies if this needs to be split into another topic for visibility, but I figure I’ll ask it as it is slightly related.
Each page is really only consisting of one wrapper element that makes a query to Contentful for a list of “Page Zones” (components that represent rectangular blocks of content)
This initial list has a similar structure to what you described, I obtain the list of ID’s, I pass the ID as a prop for each item, and have the child components render based off a conditional guard. Some screenshots below to make sure i’ve described it correctly
Here is the page zone renderer component on a page
Here is what the component consists of, child elements with conditional guards based off of a nested API call for content
My pages do load slowly as this is a nesting of API Calls, and I don’t think I can speed this up without some sort of database caching information.
The goal is to give my content editors flexibility in Contentful to move content blocks around the site, and just have the pages draw based on ordering and type. This is my first shot at something like this in plasmic, and so far, this has been “working” but I cannot help but feel I am making this harder than it needs to be. If the pages are loading slowly I must be doing something non-sensical.
Do you have any guidance if I’m down the right path with this? A page so far takes almost 2 seconds to load, and that seems slow by modern standards
Thank you again