Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
please provide a valid dynamic breadcrumb schema JSON-LD script
Solved! Go to the solution
This is an accepted solution.
@LookandAdorn Please find the code below:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ shop.url }}"
},
{%- if template == 'collection' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
}
{%- elsif template == 'product' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
},
{
"@type": "ListItem",
"position": 3,
"name": "{{ product.title }}",
"item": "{{ product.url }}"
}
{%- else -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ page.title }}",
"item": "{{ shop.url }}{{ request.path }}"
}
{%- endif -%}
]
}
</script>
This is an accepted solution.
@LookandAdorn Please use updated one
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ shop.url }}"
},
{%- if template == 'collection' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
}
{%- elsif template == 'product' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ product.title }}",
"item": "{{ product.url }}"
}
{%- else -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ page.title }}",
"item": "{{ shop.url }}{{ request.path }}"
}
{%- endif -%}
]
}
</script>
This is an accepted solution.
@LookandAdorn Please find the code below:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ shop.url }}"
},
{%- if template == 'collection' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
}
{%- elsif template == 'product' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
},
{
"@type": "ListItem",
"position": 3,
"name": "{{ product.title }}",
"item": "{{ product.url }}"
}
{%- else -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ page.title }}",
"item": "{{ shop.url }}{{ request.path }}"
}
{%- endif -%}
]
}
</script>
Getting the below mentioned error -
https://search.google.com/test/rich-results/result/r%2Fbreadcrumbs?id=iXdYNY8SDyGgPHYlIrJEBw
This is an accepted solution.
@LookandAdorn Please use updated one
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ shop.url }}"
},
{%- if template == 'collection' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
}
{%- elsif template == 'product' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ product.title }}",
"item": "{{ product.url }}"
}
{%- else -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ page.title }}",
"item": "{{ shop.url }}{{ request.path }}"
}
{%- endif -%}
]
}
</script>
@webwondersco wrote:@LookandAdorn Please use updated one
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ shop.url }}"
},
{%- if template == 'collection' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ collection.title }}",
"item": "{{ collection.url }}"
}
{%- elsif template == 'product' -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ product.title }}",
"item": "{{ product.url }}"
}
{%- else -%}
{
"@type": "ListItem",
"position": 2,
"name": "{{ page.title }}",
"item": "{{ shop.url }}{{ request.path }}"
}
{%- endif -%}
]
}
</script>
Thank you 👍 so much. I appreciate your quick response
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024