Use different Schema based on Collection fields

Hi folks,

Been stumped on this for the last couple of hours so wondered if anyone could help.

I’m trying to add Breadcrumb Schema to one of my collection items.

The idea is to show google that even though the URL structure of the site is

Home > Collection > Collection Item

…The website is actually structured more like this:

Home > Category > Sub-Category > Collection Item

I can do this fine, because each Collection Item has a Reference Field where I select the Category or SubCategory. It’s all good…

THE PROBLEM

The challenge comes in here because not all of my Collection Items have a Subcategory.

So the normal schema doesn’t work, because one of the breadcrumbs is blank.

I’ve tried using IF logic within the

Any ideas people? Would love some assistance! :pray:


Here is my public share link: https://preview.webflow.com/preview/yeshomebuyers?utm_medium=preview_link&utm_source=designer&utm_content=yeshomebuyers&preview=ceb126b5a7b6e085f78566e1573f30d7&pageId=609f9fdad8673ba767633aae&itemId=609fab2d232963a24f03aec0&mode=preview

Right… looks like Webflow has cut off about 2/3rds of my message. I’m assuming you can’t see the explainer of what I’m trying to do or my example code :man_facepalming: :man_facepalming:

Need a break before rewriting it :man_facepalming:

I have the same issue explained in this answer here, and a new post here
Did you find a solution?