Forum Discussion
MattV
19 days agoKhoros Staff
You can add properties to a component to allow simple configuration.
For example, the following component json:
{
"id" : "Announcement",
"markupLanguage" : "HANDLEBARS",
"defaults" : {
"config" : {
"applicablePages" : [ ],
"description" : "",
"fetchedContent" : null
},
"props" : [ {
"id" : "announcement_text",
"dataType" : "STRING",
"list" : false,
"label" : "Announcement Text",
"description" : "Announcement text to display",
"control" : "INPUT"
} ]
},
"components" : [ {
"id" : "custom.widget.Announcement"
} ],
"grouping" : "CUSTOM",
"scriptGroups" : null,
"aboutThis" : null
}
Adds a simple input box to the component settings in designer where an Admin can add announcement text.
I handlebars, I access the text with {{component.props.announcement_text}}