XF 2.2 Adding a JSON-LD Script to forum_list

tomwood

Member
Licensed customer
Hello,

I added this JSON-LD script at the very top of the forum_list template, but in View Source it shows after line 491, whch seems random, to me. Should I be adding the script a different and better way? Or is Xenforo putting it where it belongs?

I put it in this template so it shows only on the homepage. It references a Page where there is more information in another script.

<div class="p-body-pageContent"> (This is line 491 in the View Source output)

Code:
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BookSeries",
  "@id": "https://hopepunks.net/",
  "name": "Hopepunks",
  "url": "https://hopepunks.net/",
  "hasPart": [
    {
      "@type": "Book",
      "name": "Clarity or Delusion: A Hopepunk Whomps the Fat Cats",
      "url": "https://hopepunks.net/pages/clarity-or-delusion-who-what-where-to-buy/"
    }
  ]
}
</script>

<div class="block block--category block--category71">

Thanks!
 
Never mind, I wrapped it in some tags that moved it to the <head>:

Code:
<xf:head option="ld_json">
…
</xf:head>

BTW, Gemini has become my new bestie for this sort of stuff!
 
Back
Top Bottom