Start page / Enhanced JSON support / JSON output of media

JSON output of media

It is also possible to hand over a medium to the JSON function. This creates a JSON object with all relevant information for the corresponding medium.
In this manner it is also possible to create a “media publication” which creates the JSON information for each medium in a JSON file and additionally writes the media itself into the file system.

Here is an example of a page template that generates all media in the project accordingly:

$CMS_SET(storeType, class("$Type"))$
$CMS_SET(mediaClass, class(""))$
$CMS_FOR(file, #global.project.userService.getStore(storeType.MEDIASTORE, true).
children(mediaClass, true))$

With this example, all media of the project are created and the corresponding information is written into a JSON document.

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