Skip to main content
Version: Next

Properties

General​

Every element (document, asset, data object) can carry custom properties, accessible via the Properties tab.

Properties in the documentProperties in the documentProperties in the document

Properties control rendering behavior in templates. Common use cases:

  • Hide the main navigation
  • Show the sidebar
  • Load an additional stylesheet

Access a Property in a Template​

{# retrieve the value of a property named "hideNavigation" #}
{% set hideNavigation = document.getProperty('hideNavigation') %}

Inherited Properties​

Properties marked as inheritable are also returned by getProperties() and getProperty() of the child elements (assets, documents and data objects). To get only the properties an element has itself, switch the inheritance off for a piece of code with Pimcore\Model\Element\Service::useInheritedProperties(); the previous setting is restored afterwards, also when the callable throws:

use Pimcore\Model\Element\Service;

$ownProperties = Service::useInheritedProperties(false, static fn () => $document->getProperties());

Inside the callable, setProperty() and removeProperty() keep the inherited properties of the element.

Predefined Properties​

Predefined properties show editors which properties are available in your Pimcore installation and provide default values for each. This guides editors toward consistent usage and reduces repetitive configuration when adding properties to elements.

Predefined does not mean the value is automatically available on every element. For globally available key-value pairs, use Website Settings instead.

Predefined properties - selectboxPredefined properties - selectboxPredefined properties - selectbox

Configuration Example​

Open Data Management > Predefined Properties in Pimcore Studio to manage predefined properties.

NameRequiredDescription
NameYesFriendly name shown in the selection dropdown.
DescriptionNoExplains the purpose of this property to editors.
KeyYesThe key used in code to retrieve the property value, e.g. $document->getProperty("key");
TypeYesAllowed content type: text, document, asset, object, bool (checkbox), or select.
ValueNoDefault value added automatically when the property is assigned to an element.
ConfigurationNoAdditional configuration. Currently only used by the select type - specify options separated by commas.
Content-TypeYesElement types this property applies to (document, asset, or object).

Note Each predefined field can be overridden on the individual element after assignment.