This content originally appeared on DEV Community and was authored by Kenneth McAndrew
There is a feature in Sitecore renderings called Rendering Contents Resolvers…you’ll find a dropdown near the bottom of the settings for a rendering. There’s a few entries there, like Context Item, Datasource with Children, Context Item with Children, Navigation…all kind of self-explanatory, all useful…
And all toxic in Sitecore XM Cloud. All. Of. Them.
Working on a big XM Cloud project, also my first, has been a heck of an experience. One thing early on we struggled with was how to create a sitemap page, and how to create a contextual navigation component. We were directed by Sitecore to the Navigation rendering content resolver, which is also used on their out of the box Navigation rendering. With that “blessing” in mind, we also would use other content resolvers to help expedite some of our work.
What we ran into was publishing hell. There were times that we’d do a publish from Pages (which is a smart publish by default), only to not see Experience Edge update with the appropriate content. This wasn’t just on a site level for that data folder, but even content directly subordinate to the page. It would take a republish, and sometimes more than one, to fix the problem. We’re using the Edge publishing model as well, sometimes referred to as the “v2” model, which isn’t supposed to require a publish of all pages when a change is made to ancillary data.
We didn’t even thing of the content resolvers, since Sitecore had said the navigation one was okay, so why wouldn’t the others? But the struggles on publishing reached a breaking point and we’ve been raising it so far up the flagpole, I think the flag is popping off the top of the pole. Pinging support about it when we had a clear sample of the issue, we finally got an answer.
“The fact that the component uses rendering contents resolver is important because it changes the internal reference to the data source used by the page’s layout. Such configuration requires you to republish the page itself to update the layout”
Uhhh…what? A content resolver changes the internal reference to the data source used by the page’s layout? Well that wasn’t advertised! On another matter, Sitecore referred us to their Publishing to Experience Edge Accelerate recipe, and sure enough there’s a section in there about content resolvers. But…if you read it carefully, it says custom resolvers are not supported, but specifically mentions the navigation resolver that should be utilized.
Friends, I haven’t written a blog in two years, because I was in the PM wilderness, but now that I have crossed back to the garden of development, let me preach to you…DO NOT USE RENDERING CONTENTS RESOLVERS AT ALL!
Ahem…sorry.
But seriously…don’t. We started yanking them from our project, and I’ve noticed publishing getting markedly better. The challenging part was the navigation resolver replacement…how to do it right, how to use the rendering parameters, etc…but there was a way. And I’ll be glad to share it with you all…
Next post.
This content originally appeared on DEV Community and was authored by Kenneth McAndrew