> > |
- JSON Syntax:
%SET{ name = { ... } remember="1" }% - see description.
- An optional
remember="1" or store="..." parameter can be appended. If specified, the JSON object will be stored persistently so that it can be used later in any TWiki topic.
- Example to set, modify and get a JSON object:
-
%SET{ menu = { "File": { "New": [ "new", "F" ], "Open": [ "open", "F" ] }, "Edit": { "Copy": [ "cpy", "F" ], "Paste": [ "pst", "F" ] } } }% - set a JSON object
-
%GET{ menu }% - returns: {"File":{"New":["new","F"],"Open":["open","F"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"]}}
-
%SET{ menu.File.Open[1] = "T" }% - modify a JSON object
-
%GET{ menu }% - returns: {"File":{"New":["new","F"],"Open":["open","T"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"]}}
-
%SET{ menu.Edit.Cut = [ "cut", "T" ] }% - add to a JSON object
-
%GET{ menu }% - returns: {"File":{"New":["new","F"],"Open":["open","T"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"],"Cut":["cut","T"]}}
|