How to add structure data to collections?

Hello, as in the topic, I added all structure data for my sites but have left blog sites generated by collections for single blog posts and single gallery sites. How can I add structure data for every individual blog?

Should I create some sort of variables or any kind of dynamic data with ( {{ title }}, {{ author }}, {{ publish_date }}, {{ image_url }}, {{ content }}, i {{ url }})? is it possible and how?

You can right click on single page of blog > settings.

Then go to schema markup, and create new schema, now inside of schema you can custom write variables similary to what you wrote above.

In screenshot below you can see examples, they I am using variables to get dynamic content from CMS such as:

${page->get('data')->get('description')}

Theres more explained here:

1 Like

Thanks a lot :slight_smile: this will help me !

Will add examples from my site, maybe someone will be happy about it :slight_smile:

for single blog post:
{
@context”: “https://schema.org”,
@type”: “BlogPosting”,
“mainEntityOfPage”: {
@type”: “WebPage”,
@id”: “${page->get(‘data’)->get(‘id’)}”,
“url”: “https://www.wytwornia-zieleni.pl/blog/${page->get(‘data’)->get(‘slug’)}
},
“headline”: “${page->get(‘data’)->get(‘seo’)->get(‘title’)}”,
“description”: “${page->get(‘data’)->get(‘seo’)->get(‘description’)}”,
“image”: “${page->get(‘data’)->get(‘seo’)->get(‘cover’)->get(‘file’)}”,
“author”: {
@type”: “Person”,
“name”: “Wojciech Kazimierowicz”
},
“publisher”: {
@type”: “Organization”,
“name”: “Wytwórnia Zieleni”,
“logo”: {
@type”: “ImageObject”,
“url”: “https://global.divhunt.com/a67b47fe98589e135c4e1b506482bec4_21516.png
}
},
“datePublished”: “${page->get(‘data-publikacji’)->date(‘D M Y’)}”
}

For single gallery page (nasze-realizacje)
{
@context”: “https://schema.org”,
@type”: “BlogPosting”,
“mainEntityOfPage”: {
@type”: “WebPage”,
@id”: “${page->get(‘data’)->get(‘id’)}”,
“url”: “https://www.wytwornia-zieleni.pl/blog/${page->get(‘data’)->get(‘slug’)}
},
“headline”: “${page->get(‘data’)->get(‘seo’)->get(‘title’)}”,
“description”: “${page->get(‘data’)->get(‘seo’)->get(‘description’)}”,
“image”: “${page->get(‘data’)->get(‘seo’)->get(‘cover’)->get(‘file’)}”,
“author”: {
@type”: “Person”,
“name”: “Wojciech Kazimierowicz”
},
“publisher”: {
@type”: “Organization”,
“name”: “Wytwórnia Zieleni”,
“logo”: {
@type”: “ImageObject”,
“url”: “https://global.divhunt.com/a67b47fe98589e135c4e1b506482bec4_21516.png
}
},
“datePublished”: “${page->get(‘data-publikacji’)->date(‘D M Y’)}”
}

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.