In the node type creation pop-up window there are fields for the following node properties:
myComponent
)jnt:content
)jmix:basicContent
)When the new type is declared, properties can be added by name and type.
Simple properties can be of type :
String
Long
Double
Boolean
Weakreference: reference to a node in the JCR
In the "Properties" tab of the node type creation pop-up window, the "add" button can be clicked. In the following example, a new property of type String is being created:
Jahia uses definitions to build the Edit and Contribute user interfaces. The property editing forms are rendered based on the property type. However, the form can be configured with a Selector. The standard syntax is as follows:
property_name (type, selector [options])
Examples:
field-name (string)
field-name (string, richtext)
field-name (string, choicelist)
field-name (long)
field-name (boolean)
field-name (weakreference, picker [type = 'image'])
field-name (date, datepicker)
field-name (weakreference) < mynt:SomeOtherComponent
mynt:SomeOtherComponent
In Jahia Studio, a Property of type date
could be added, with a Selector type of datepicker
:
An example of adding a property for a Photo with the image selector option:
A property with a constraint on its type:
Switching to the Page Composer, the new Component appears in the list of available components when adding content to a page.
Once the title is added an error message appears:
no render set for node : my-first-component
for types : [mynt:myComponent]
Rendering will be covered in a later section.
To help prepare for the following exercise, the following tutorial provides a step-by-step walkthrough on Defining Content Types with a newsItem component.
If done correctly, the following message will be displayed:
No render set for node : employee for types : [mynt:employee]