How to modify values in the JSON structure associated with a Blot page?

All the Blot data like entries and tags are stored in a JSON structure associated with each page. (I mean the JSON data I can see when I add ?debug=true to the page.)

When I'm on the page how can I access (and modify) this JSON info via JavaScript, say, in the load event? I assume the JSON structure is stored as an object somewhere in the DOM?

2 replies

You could use JS to make a second web request to the same page with the query string ‘debug=true’

Or you could hard code the variables needed into a script tag within the template view.

The second method is best, in my opinion

Answered 3 months ago · Improve this answer

Sorry, I'm not 100% with you; what do you mean with "hard code the variables needed into a script tag within the template view"? E.g. I want to use the Blot tags variable, how do I access it from JavaScript?

Answered 3 months ago · Improve this answer

Markdown allowed
Question or feedback?
Contact us

Tags

developers 28 questions bug 14 questions posts 9 questions resolved 7 questions request 6 questions google-drive 5 questions configure 4 questions pages 3 questions added 3 questions meta 3 questions More tags →
Subscribe for changes
RSS Feed of latest questions