Roots Discourse / Rich Snippets & Structured Data

I began this journey and came across this: Microdata/Schema/Rich Snippets and I didn’t want to ressurect a 5 year old thread

And While I definitely agree with @benword’s sentiment that a defacto feature shouldn’t be included, however, maybe there should be a “recommended” plugin and installation?

I’m still getting used to how custom plugins should behave in the “sage” world of things, and I and many others would likely find this very beneficial.

Does anyone have any recommendations and approaches on how to implement a basic structured data plugin or something custom for Sage 9.0. I’d appreciate any help I can find.

Shouldn’t SEO related plugins already generated at least some amount of related data?

@strarsis, No, but maybe it’s user error? I tried Yoast, but didn’t have luck. The SEO Framework seems promising. If it should work I’d gladly use it. What is your recommendation? Yoast in the admin feels super advertisy (Made up word) lol. I just want to use something that is known to work with Sage and I can figure out.

I personally found that adding structured data was best done at theme level and built specifically from the ground up. For example we introduced event schema markup. We originally went for microdata markup (using itemProp inline for example).

However after implementation we found that microdata wasn’t indexed as effectively as JSON-LD schema data, example: Also microdata and inline schema markup really bloated template files, and slowed down development.

We also tried a few plugins in a bid to save time. But after not much success due to the amount of custom data we have, we quickly converted to custom JSON-LD markup. It was really easy to implement and indexing is almost instantaneous with Google.

This is handy for testing:

In terms of Sage, you can use the @stack directive and @push directive to push data through json_encode from within any template partial - generally when you’re looping through your data to output it as you normally would. We then output that stack in the head of the document. So long as you configure your data array to have the JSON-LD keys that Google suggests it’s fairly straight forward.

The one caveat of this approach is that it’s a developer implementation and not something with a front end



Would you mind sharing an example of how @stack and @push work in the context of JSON-LD. I’d really appreciate a real life example. I understand the Google Structured Data tool quite well from my experience with Magento, but Sage and Blade are completely new to me. Unfortunately, I just can’t wrap my head around how to work with data in that way.

This topic was automatically closed after 42 days. New replies are no longer allowed.