Wondering if anyone has a HubL snippet they use for dynamically generating JSON-LD for breadcrumbs. I originally thought `content.topic_list` would contain every segment in the blog post’s URL, but I was incorrect. Given the following URL:
Hi, @DInc Thanks for your question. I’d like to invite some of our community experts to the conversation — hey @albertsg@alyssamwilie@Anton@Teun do you have any experience creating this dynamically in the manner @DInc is describing?
I found this blog post from @AJLaPorte that I’ll leave for other folks who may come across your post when searching.
Thanks for your reply @Jaycee_Lewis. After many attempts - and failures - in generating a dynamic list of absolute URLs from a URL with multiple segments, I decided to add a repeater Bradcrumbs schema field as a module and let the editor speficy them on their own. Though, if there was an object provided to keep track of the various ‘crumbs’ leading to every page/blog post, I imagine we could iterate through that to generate a viable BradcrumbList schema.
This wouldn’t work because each segment’s absolute url would need to contain the previous segment as part of its url, if it exists. Using your example, I would end up with `https://www.mysite.com/page-name` as the last segment’s absolute URL, which would be incorrect.