Start page / Template development / Template syntax / Functions / in instructions / json

json(...)

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

The json() function will transform any FirstSpirit element into a JSON object structure.

This JSON object structure can then be rendered to the JSON channel using a $CMS_VALUE(...)$ statement. The most basic use case would render an FirstSpirit page as a JSON document:

$CMS_VALUE(json(#this))$ 

In this statement the current page #this is passed to the json() function, which transforms the page into the JSON object structure. JSON object structure is then rendered to the JSON channel using the surrounding $CMS_VALUE(...)$ statement.

Documentation:

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.4 | Data privacy