XF 2.3 Changing the CreativeWork Schema Type

SelamT

Active member
Hello,

I want to change the CreativeWork schema type in the Resources add-on to "Book".
Unfortunately Google Search Console doesn't like this. In a previous message you said that you accepted this error and would not change it. However, I prefer to change it manually.
I wonder which template you moved this to, I couldn't find it.
Can you tell me where it is?

Thank you
 
Solution
It looks like Google wants name instead of headline :rolleyes:

HTML:
        {{ $resource.getLdStructuredData()|json(true)|replace({
            '"CreativeWork"': '"Book"',
            '"headline"': '"name"'
        })|raw }}
The structured data is generated in PHP now. You can still make simple overrides by replacing or merging into the array or resulting string in the xfrm_resource_view template:

HTML:
{{ $resource.getLdStructuredData()|json(true)|replace('CreativeWork', 'Book')|raw }}
 
Although I did Book, Google didn't like it again and gives error to the following codes.

JavaScript:
"aggregateRating": {
"@type": "AggregateRating",
"ratingCount": 1,
"ratingValue": 5
}
 
It looks like Google wants name instead of headline :rolleyes:

HTML:
        {{ $resource.getLdStructuredData()|json(true)|replace({
            '"CreativeWork"': '"Book"',
            '"headline"': '"name"'
        })|raw }}
 
Solution
Back
Top Bottom