Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello everyone,
My JSON LD schema markup works great on my domestic pages and has been validated with Rich Results Test / Schema.org validator.
However, once I go to an international version of a page on my website (subfolder directory - example.com/en-au/ ), the Schema is no longer populating the page HTML nor is it showing up in validators.
What's happening here?
To explain my set up further:
Appreciate any insight! Thanks
Solved! Go to the solution
This is an accepted solution.
Well for anyone having this issue, I have solved it myself. I was rendering the snippets incorrectly based on page path.
For example:
Incorrect:
{%- if request.path == '/collections/mens-shoes' -%}
{% render 'schema-mens-shoes' %}
{%- endif -%}
Correct:
{%- if request.path contains '/collections/mens-shoes' -%}
{% render 'schema-mens-shoes' %}
{%- endif -%}
Notice in the correct example I use contains instead of ==
I incorrectly assumed that just leaving the tail end of page path would leave room for whatever sub-directory.
This is an accepted solution.
Well for anyone having this issue, I have solved it myself. I was rendering the snippets incorrectly based on page path.
For example:
Incorrect:
{%- if request.path == '/collections/mens-shoes' -%}
{% render 'schema-mens-shoes' %}
{%- endif -%}
Correct:
{%- if request.path contains '/collections/mens-shoes' -%}
{% render 'schema-mens-shoes' %}
{%- endif -%}
Notice in the correct example I use contains instead of ==
I incorrectly assumed that just leaving the tail end of page path would leave room for whatever sub-directory.
Also see https://shopify.dev/docs/storefronts/themes/markets/multiple-currencies-languages
https://shopify.dev/docs/api/liquid/objects/localization
and request.origin etc https://shopify.dev/docs/api/liquid/objects/request#request-origin
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024