A checkbox field can be configured to be checked by default when a new object is created.
It is stored in a TINYINT column in the database with the value 0 or 1.
In order to set a checkbox value, a bool value needs to be passed to the according setter of the object:
If inheritance is activated in the corresponding DataObject class, a trashcan icon is displayed next to the checkbox. This can be used to reset the value of the checkbox in order to guarantee inheritance from parents again.
Boolean Select is kind of a tri-state checkbox which is rendered as a select datatype in the admin UI.
The background is that a checkbox can only have two states. This is especially important when it comes to inheritance.
A checkbox treats an empty (never set) value just like the unchecked value. The consequence is then as soon as a parent sets it
checked you can not reset it to
unchecked in the child nodes anymore.
The boolean select takes care of this problem by introducing a third state. The storage values are -1 (for unchecked), 1 (for checked and
null for empty.
For the admin UI you can specify the display values according to your needs. Default values are
In the UI a link is displayed as text. Its details can be edited by clicking on the button next to the link text. In the object class definition there are no special configurations available for an object field link.
The link object field has its own data class which is
Pimcore\Model\DataObject\Data\Link. In order to set a link
Pimcore\Model\DataObject\Data\Link object needs to be instantiated and passed to the setter:
$l = new DataObject\Data\Link();
In the database the link is stored in a TEXT column which holds the serialized data of an
In the frontend (template) you can use the following code to the the html for the link.
$object = DataObject::getById(234);
<li><?= $object->getMyLink()->getHtml(); ?></li>
Please also see the section about Link Generators
Allows to store RGBA Values. RGB and Alpha values are stored as hex values in two separate columns as hex values in the database.
$o = \Pimcore\Model\DataObject\User::getById(50);
// get the color, can be null!
$color = $o->getMyColor();
// get the RGB part as hex with leading #
// get the RGBA value (with alpha component) has without leading hash
// get the RGBA value as array (R,G,B 0-255, Alpha 0-1)
// set the RGBA value
$color->setRgba(0, 0, 255, 64);
Offers data encryption for certain data types.
Prerequisites: generate a secret key by calling vendor/bin/generate-defuse-key and add it to config/config.yaml
In strict mode (which is the default) an exception is thrown if existing data cannot be decrypted (e.g. because of a key change). You can switch this off by calling
A slug is the part of a URL which identifies a particular page on a website in an easy
to read form. In other words, it’s the part of the URL that explains the page’s content.
For example, if the URL is
https://demo.pimcore.fun/slug, then the slug simply is
This data-type can be used to manage custom URL slugs for data objects, you can add as many fields of this type to a class as you want. Pimcore then cares automatically about the routing and calls the configured controller/action if a slug matches.
You could use the Symfony String component's slugger to generate the slugs.
Note that slugs can't contain the following chars:
? #since they are reserved characters. For more information check the RFC 3986.
class ProductController extends FrontendController
public function slugAction(Request $request, DataObject\Foo $object, DataObject\Data\UrlSlug $urlSlug): array
// we use param resolver to the the matched data object ($object)
// $urlSlug contains the context information of the slug
'product' => $object