ModelMenus module

Element

A model in the Menus module, with 43 members for templates, 28 API properties and 47 members for admin templates.

Menus\Models\Frontend\Element Menus\Models\Api\Element Menus\Models\Backend\Element Also in Menus: ControllerParameter ElementCustomFieldValue Menu MenuCustomFieldValue
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 34

Take no arguments.

# getId()
?int
# getName()
?string
# getType()
?string
# getUrl()
string
Get the URL for this menu element
# getControllerName()
?string
# getController()
?string
# getModuleRoute()
?string
# getControllerRoute()
?string
# getResponseVariable()
?string
# getIncludeChildren()
?bool
# getDisplayProperty()
?string
# getPosition()
?int
# getEntity()
?string
# getRecordId()
?int
# getCreated()
?DateTime
# getModified()
?DateTime
# getParent()
?Element
# getChildren()
Collection<Element>
Get the children of this menu element
# getMenu()
?Menu
# getControllerParameters()
?Collection<ControllerParameter>
# getSite()
?Site
# getPublished()
?DateTime
Date at which the page was published
# isPublished()
bool
Determines if the record is published.
# getCustomFieldValues()
?Collection<ElementCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# getFullPosition()
string
Get the full, dot-separated full position for hierarchical records
# getExternalId()
?string
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned
# isActive() Templates only
bool
Check if the current menu element is active
# hasActiveChild() Templates only
bool
Check if the current menu element is active
# hasChildren() Templates only
bool
Check whether the menu element has children
# getAllParents() Templates only
Collection
Get all parents for the current record, ordered by root record => the closest record

Methods 9

Take arguments. The API serialises only getters that need none.

# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# getCustomFieldValueByName(string $customFieldName)
?CustomFieldValue
Get the value for a custom field by the custom field name
# getCustomFieldContent(string $customFieldName)
?Content
Get the content for the custom field identified by the specified name
# getCustomFieldContentOrDefault(string $customFieldName)
?Content
Get the (default) content for the custom field identified by the specified name
# getCustomFieldBoolean(string $customFieldName, ?bool $default)
?bool
Get the (default) content of the custom field as boolean value
# getCustomFieldText(string $customFieldName, ?string $default)
?string
Get the (default) content of the custom field as text
# getCustomFieldImage(string $customFieldName)
?Image
Get the (default) image contained in the custom field
# getCustomFieldFile(string $customFieldName)
?File
Get the (default) file contained in the custom field
# hasCustomField(string $customFieldName)
bool
Check if the entity has a custom field with the specified name

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 28

Read-only values on the record.

# id
?int
# name
?string
# type
?string
# url
?string
# controllerName
?string
# controller
?string
# moduleRoute
?string
# controllerRoute
?string
# responseVariable
?string
# includeChildren
?bool
# displayProperty
?string
# position
?int
# entity
?string
# recordId
?int
# created
?DateTime
# modified
?DateTime
# parent
?Element
# children
?Collection<Element>
# menu
?Menu
# controllerParameters
?Collection<ControllerParameter>
# site
?Site
# published
?DateTime
Date at which the page was published
# published
bool
Determines if the record is published.
# customFieldValues
?Collection<ElementCustomFieldValue>
# customFieldContent
object
Get a serialized representation of the custom fields associated with the record
# customFields
array
Get the custom fields for this entity
# fullPosition
string
Get the full, dot-separated full position for hierarchical records
# externalId
?string

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 38

Take no arguments.

# getId()
?int
# getName()
?string
# getType()
?string
# getUrl()
?string
# getControllerName()
?string
# getController()
?string
# getModuleRoute()
?string
# getControllerRoute()
?string
# getResponseVariable()
?string
# getIncludeChildren()
?bool
# getDisplayProperty()
?string
# getPosition()
?int
# getEntity()
?string
# getRecordId()
?int
# getCreated()
?DateTime
# getModified()
?DateTime
# getParent()
?Element
# getChildren()
?Collection<Element>
# getMenu()
?Menu
# getControllerParameters()
?Collection<ControllerParameter>
# getSite()
?Site
# getPublished()
?DateTime
Date at which the page was published
# isPublished()
bool
Determines if the record is published.
# getCustomFieldValues()
?Collection<ElementCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# getFullPosition()
string
Get the full, dot-separated full position for hierarchical records
# getExternalId()
?string
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned
# getAvailableParents() Admin only
Collection
Get the available parents for the element. Fetches only elements that do not have the parent. You can access children calling {@link getChildren()}. Consider that current element will be also inside returned data.
# getCreateChildUrl() Admin only
?string
Get the url for creating a child record.
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getMoveUrl() Admin only
?string
Get the url for moving the record.
# getDeleteUrl() Admin only
?string
Get the url for deleting the record.
# getPublishUrl() Admin only
?string
Get the url for publishing the record.
# getManageUrl() Admin only
?string
Get the url for managing records.

Methods 9

Take arguments. The API serialises only getters that need none.

# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# getCustomFieldValueByName(string $customFieldName)
?CustomFieldValue
Get the value for a custom field by the custom field name
# getCustomFieldContent(string $customFieldName)
?Content
Get the content for the custom field identified by the specified name
# getCustomFieldContentOrDefault(string $customFieldName)
?Content
Get the (default) content for the custom field identified by the specified name
# getCustomFieldBoolean(string $customFieldName, ?bool $default)
?bool
Get the (default) content of the custom field as boolean value
# getCustomFieldText(string $customFieldName, ?string $default)
?string
Get the (default) content of the custom field as text
# getCustomFieldImage(string $customFieldName)
?Image
Get the (default) image contained in the custom field
# getCustomFieldFile(string $customFieldName)
?File
Get the (default) file contained in the custom field
# hasCustomField(string $customFieldName)
bool
Check if the entity has a custom field with the specified name