0

This is my first time using Ektron and i'm trying to implement Json-LD schema scripts for each page. I have 68 scripts that I need to implement that are unique for each page.

I thought I would be able to implement these scripts through meta data, but now i'm unsure. Each script is over 1000 characters, the html and meta tag types only allow 500 characters, so i'm assuming i'm in the wrong place. If anyone could shed some light it would be much appreciated.

  • 500 characters -- is this limitation coming from Ektron? And does it also apply to content of a `script` element? – unor Sep 20 '17 at 15:03
  • I believe the limitation is coming from Ektron. I'm used to working with Shopify and wordpress, so this is all very new to me. I've been reading through the documentation, but i'm not having much luck. I took some screen shots that might better show what I'm trying to accomplish. https://imgur.com/a/NUmrn Not sure if I can explain it better, but I just need to find the right spot to implement these scripts, so they end up in the header of each page, so the user can't see it, but google crawlers can better understand each page. – Andrew Wiggins Sep 20 '17 at 15:08
  • Okay. I don’t know Ektron, but maybe it helps you to know that you don’t have to place the JSON-LD `script` elements in the `head`. You [can place them in the `body`](https://stackoverflow.com/a/28688394/1591669), too, and by default they won’t be visible. – unor Sep 20 '17 at 16:03
  • Not alot of people do know Ektron and thats why i'm struggling finding answers on implementation. Yeah, I figured it would just be better to put them in the head rather the body. – Andrew Wiggins Sep 20 '17 at 16:11

1 Answers1

0

Ektron's metadata isn't intended for large chunks of data / content. So, yes, you will find limits there.

Here are two things you might try as workarounds.

Most direct:

Use the Ektron Library. Go to the Library tab and click on the Root node and view Properties. Add an extension to allow you to upload your JSON-LD as a file. Use metadata on the content item to reference the uploaded file. Combine the two upon output.

If you want the JSON-LD to be editable within the CMS...

Gaming the platform a bit

Create a new SmartForm definition and include in it a single plain-text, multi-line field (not Rich text). This should hold your JSON-LD. Set up a folder and, if your version supports it (you didn't specify CMS version, so I will assume relatively recent), set the folder to be non-searchable so these things don't come up in site search results. Add a restriction to the folder to only allow the Smart Form definition you just created. Create your JSON-LD there using the plain-text field. You should be able to store up to 1MB.

Same as above, add your JSON-LD as text then use a reference to this item from the content you want to use it.

The metadata in this case (and possibly the library one, though I'd have to test and I don't have an Ektron environment for development anymore) will give you the Content ID for the object holding your JSON-LD. You'll have to make another API call but will give you the solution you appear to want from above.

egandalf
  • 898
  • 5
  • 8