We are working on an MVC web site where we are following the principles of atomic design, with heavy use of placeholders (including dynamic) and very granular renderings. This site's pages are heavily customizable using an approach similar to True Item Rendering.

We want to implement schema.org-inspired structured data for (Google) SEO, using the recommended JSON-LD format. You can find an introduction on Google's site.

Surprisingly, our authors want the same level of control over these data blocks as they have over displayed content. Unfortunately, I doubt you can insert a placeholder within a script tag, so flexibility is limited.

As an example, Google's sample for an article looks like this (abbreviated for clarity):

<script type="application/ld+json">
  "@context": "http://schema.org",
  "@type": "NewsArticle",
  "headline": "Article headline",
  "image": [
  "author": {
    "@type": "Person",
    "name": "John Doe"
  "publisher": {
    "@type": "Organization",
    "name": "Google",
    "logo": {
      "@type": "ImageObject",
      "url": "https://google.com/logo.jpg"

Complicating matters further is the fact that fields can accept various types of data -- for instance, author can be a Person or an Organization.

My current approach for this involves a main Article template, along with several link types for author, publisher, etc. These objects can in turn contain links to other objects. I fear this will become unmanageable in the long run, though it does make JSON serialization very easy using Glass Mapper.

I've considered the following solutions:

  • Allow authors to paste in the entire JSON block. I've seen that elsewhere, but I'd rather avoid it.
  • Have the renderings themselves register the data (either explicitly or by a rendering processor), then spit it out as JSON-LD at the bottom of the page. This solution curtails the flexibility our authors crave.

Are there any other approaches I should consider? Has anyone else come across this? Any OOTB solutions I should be aware of?

  • have you been able to reach a solution for this? Commented Nov 1, 2022 at 9:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.