Let's say your code (simplified) looks something like this
Code: Select all
[
{
"id":"$myid00",
"type":"something",
"author":"anyone",
"A":1,
"B":2,
"C":[1,2,3,4]
},
{
"id":"$myid01",
"type":"something",
"author":"anyone",
"A":1,
"B":2,
"C":[1,2,3,4],
"D":"Test" // Additional attribute
},
{
"id":"$myid02",
"type":"something",
"author":"anyone",
"A":8, // Different value for A
"B":2,
"C":[1,2,3,4]
}
]
Code: Select all
[
{
"id":"$mytemplate00",
"type":"template",
"author":"anyone",
"A":1,
"B":2,
"C":[1,2,3,4]
},//<<--was missing
{
"id":"$myid00",
"type":"something",
"template":"$mytemplate00" // Reference to template, no author, A, B, C needed here anymore
},
{
"id":"$myid01",
"type":"something",
"template":"$mytemplate00" // Reference to template
"D":"Test" // Additional attribute can still be applied
},
{
"id":"$myid02",
"type":"something",
"template":"$mytemplate00" // Reference to template
"A":8 // Override value of A
}
]
Code: Select all
"type":"template"
Code: Select all
"template":"$templateid"
For convenience it can be useful to inherit from multiple templates, you can do so by providing an array of template ids:
Code: Select all
"template":["$templateid0", "$templateid1", ...]