ModelCommon module
Content
A model in the Common module, with 24 members for templates, 19 API properties and 26 members for admin templates.
Templates view
Properties 24
Take no arguments.
-
#
getText() -
?string - Get the text for this content. Also parses image and link placeholders in the process.
-
#
getRecordModel() -
?Model - Retrieve the model associated with the content for content with the 'record' category
-
#
getRecordModels() -
?Collection - Retrieve the models associated with the content for content with the 'records' category
-
#
getId() -
?int -
#
getCreated() -
?DateTime -
#
getModified() -
?DateTime -
#
getComponent() -
Component - Get the component for the content. In the frontend, this method will also return a global component. Returns a BlankComponent if no component was set.
-
#
getGlobalComponent() -
?GlobalComponent -
#
getCollection() -
?Collection<ollectionElement> -
#
getContainer() -
?Model -
#
getValues() -
array - Gets values of the content in array representation. Should be used for "multiselect" input type. Otherwise, it will always be an empty array.
-
#
isEmpty() -
bool - Checks if the content is empty. Also considers blank images, widgets or components in the frontend.
-
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
No members match the filter.
API & Jobs view
API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.
Properties 19
Read-only values on the record.
-
#
text -
?string - Get the text for this content. Also parses image and link placeholders in the process.
-
#
recordModel -
?Model - Retrieve the model associated with the content for content with the 'record' category
-
#
recordModels -
?Collection - Retrieve the models associated with the content for content with the 'records' category
-
#
id -
?int -
#
created -
?DateTime -
#
modified -
?DateTime -
#
globalComponent -
?GlobalComponent -
#
collection -
?Collection<ollectionElement> -
#
container -
?Model -
#
values -
array - Gets values of the content in array representation. Should be used for "multiselect" input type. Otherwise, it will always be an empty array.
No members match the filter.
Admin view
AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.
Properties 26
Take no arguments.
-
#
getValuesList()Admin only -
array - Gets values array that is suitable to be used in <select> tag.
In this case every key equals to its value. -
#
getPlaceholder()Admin only -
string - Gets placeholder for this content based on its value.
Usually returns encoded value of a content text.
If content is a multiselect, returns all its values separated by comma.
Returned value is encoded and can be used in HTML attributes (usually in "placeholder"). -
#
getText() -
?string - Get the text for this content. Also parses image and link placeholders in the process.
-
#
getRecordModel() -
?Model - Retrieve the model associated with the content for content with the 'record' category
-
#
getRecordModels() -
?Collection - Retrieve the models associated with the content for content with the 'records' category
-
#
getId() -
?int -
#
getCreated() -
?DateTime -
#
getModified() -
?DateTime -
#
getGlobalComponent() -
?GlobalComponent -
#
getCollection() -
?Collection<ollectionElement> -
#
getContainer() -
?Model -
#
getValues() -
array - Gets values of the content in array representation. Should be used for "multiselect" input type. Otherwise, it will always be an empty array.
-
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
No members match the filter.