I’m relatively new to Neos and having a bit of trouble with a component I’m building and wonder if anyone could give me a hint.
So I built a Banner component that’s basically a styled ContentCollection [0]
The headerBanner reference property I’ve added to the page’s configuration allows us to add a banner via the inspector. Every page may also have a headerImage, which is supposed to be displayed if no Banner is referenced or the banner is hidden. [1]
Hiding the Banner works just fine, it always correctly toggles isBannerActive. However, if I unhide a banner, isBannerActive isn’t toggled (and I assume the page isn’t re-rendered). Updating any (text) node on the page will trigger the re-rendering, hide the image and display the banner.
I have been tinkering with the cache configuration but without any success and I’ve run out of ideas.
Also note that _hidden is an internal property. Nodes that are hidden are basically non-existent in the Frontend, i.e. q(node).property('headerBanner') will be null if the referenced node is hidden (In the Neos Backend it will still be found, so I assume that you added that condition for the backend rendering)
You have to add .context({‘invisibleContentShown’: true}) in the context to get a correct caching entry also when the node gets hidden (otherwise headerBanner would be null). Than you get the element back after reactivating the headerBanner: