url
stringlengths
50
196
text
stringlengths
3
17.2k
heading
stringlengths
2
103
embeddings
list
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#select-datatypes
Select Datatypes Name Description select combo box user combo box to select from all existing Pimcore users (available since build 716) In the user settings the object dependencies of each user are shown in the second tab panel.All objects which reference the selected user are listed in a grid view.If one needs to find out which objects hold a reference to a specific user, the Pimcore\\Tool\\Admin::getObjectsReferencingUser($userId) method can be used to find all referencing objects. country combo box with predefined country list language combo box with predefined language list multiselect combo box with multiple select countries combo box with multiple select and predefined country list languages combo box with multiple select and combo box with multiple select and predefined language
Select Datatypes
[ -0.2577208876609802, 0.04474105313420296, -0.15164221823215485, 0.298753559589386, -0.05781439691781998, -0.19753652811050415, 0.27953362464904785, 0.10867594927549362, -0.23781149089336395, 0.16295000910758972, -0.4504130482673645, 0.28505784273147583, 0.028417037799954414, 0.196421444416...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#dynamic-select-datatypes
Dynamic Select Datatypes Name Description dynamic select combo box
Dynamic Select Datatypes
[ -0.09386254847049713, -0.24742597341537476, -0.24107025563716888, 0.14590875804424286, 0.11925142258405685, 0.02651795744895935, 0.15379944443702698, 0.29364773631095886, -0.2578471601009369, 0.009601528756320477, -0.1678040325641632, 0.08333738893270493, -0.07293561100959778, 0.8004361391...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#relational-datatypes
Relational Datatypes Name Description Many-To-One Relation reference to a Pimcore document, object or asset Many-To-Many Relation collection of references to Pimcore documents, objects, assets Advanced Many-To-Many Relation collection of references to Pimcore documents, objects, assets with additional metadata on the relation Many-To-Many Object Relation collection of Pimcore object references Advanced Many-To-One Object Relation collection of Pimcore object references with additional metadata on the relation Reverse Object Relation collection of Pimcore object references which are owned by a different object
Relational Datatypes
[ -0.096837118268013, 0.00038198093534447253, -0.14479891955852509, 0.1890929639339447, 0.13047944009304047, -0.11615070700645447, 0.16005490720272064, 0.17283783853054047, -0.23518970608711243, -0.16963917016983032, -0.3556899130344391, 0.04251997545361519, 0.13922859728336334, 0.0220330581...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#structured-datatypes
Structured Datatypes Name Description block repeatable block of attributes within an object classificationstore advanced store for classification systems like ETIM, ecl@ss, etc. table table input structuredtable table with predefined rows and columns fieldcollections A collection of fields that can be added to the object objectbricks Bricks of attributes, that can be added to objects localizedfields Set of attributes that can be translated
Structured Datatypes
[ -0.03764855116605759, -0.2637768089771271, -0.22023393213748932, 0.1942378282546997, 0.3662351369857788, 0.18168242275714874, 0.37570372223854065, 0.08048506081104279, 0.2929159700870514, -0.007850001566112041, -0.07757649570703506, -0.1252899318933487, -0.08873026818037033, 0.543898224830...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#geographic-datatypes
Geographic Datatypes Name Description geopoint maps widget to find longitude/latitude geobounds maps widget to define geographical bounds geopolygon maps widget to define a geographical area geopolyline maps widget to define a geographical path
Geographic Datatypes
[ -0.060128793120384216, -0.24281750619411469, -0.22557248175144196, 0.14854680001735687, 0.18742237985134125, -0.07548896968364716, 0.21384316682815552, 0.03842059150338173, 0.4885013997554779, -0.03442509099841118, -0.10811425000429153, 0.11174017190933228, 0.04873828962445259, 0.174552977...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#other-datatypes
Other Datatypes Name Description image drop area & preview for a Pimcore image asset externalimage relation to an image that is not stored in Pimcore imageadvanced drop area & preview for a Pimcore image asset with additional features for markers, hotspots, cropping imagegallery collection of Image Advanced images video drop area & preview for a Pimcore video asset checkbox checkbox link link selector with link target calculatedvalue datatype for calculated values - calculation can be defined with a PHP class
Other Datatypes
[ -0.444739431142807, -0.2699664235115051, -0.1862577199935913, 0.2211015224456787, 0.01136472262442112, -0.14633390307426453, 0.3493784964084625, 0.2680967152118683, -0.02450244314968586, 0.12889353930950165, -0.40469127893447876, 0.32448452711105347, -0.0394941084086895, 0.3879850506782532...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#crm-datatypes
CRM Datatypes Name Description firstname typed input field for firstname lastname typed input field for lastname email typed input field for email including validation gender typed and prefilled select for gender persona typed selectbox for personas defined within Pimcore personas typed selectbox with multiselect for personas defined within Pimcore consent store consent of user for something, e.g. consent for direct marketing mailing The following datatypes are only available if the PimcoreNewsletterBundle is enabled and installed: Name Description newsletteractive typed checkbox if newsletter is active newsletterconfirmed typed checkbox if newsletter is confirmed
CRM Datatypes
[ -0.09190960973501205, -0.20373135805130005, -0.015990721061825752, 0.15124864876270294, 0.057314515113830566, -0.09687836468219757, 0.16734300553798676, -0.04682803153991699, 0.0995403528213501, 0.03311918303370476, -0.21374084055423737, -0.05327364057302475, -0.07061599940061569, 0.411705...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#general-aspects
General Aspects All data types are wrapped in an object derived from Pimcore\Model\DataObject\ClassDefinition\Data. These data type objects provide getters and setters and they define the Description in the frontend. Data type objects are displayed in the first column of the table above. The second column indicates the underlying data type class and the third column outlines the Description used in Pimcore to fill in, edit and display data objects. Besides the name, which is the name of the object's property and the title, which is shown in the GUI, an object field has the general configuration options listed below. The title can be translated for different system languages. Please see the article about Translations to find out how to add object field translations. mandatory: Makes the field mandatory and does not allow saving the object when it is empty not editable: Does not allow a change of this field's value in Pimcore backend (data change can only be done programmatically) invisible: The field is not visible in Pimcore visible in grid view: Determines if the field's data column is shown in the object grid view, or hidden (meaning it has to be activated manually) visible in search result: Determines if the field's data column is shown in the search results grid, or hidden (meaning it has to be activated manually) indexed: puts an index on this column in the database unique: If checked, the value has to be unique across all objects of this class. Note that only works on top level attributes and not on nested stuff inside localized fields etc. Beware that this does not add a database index to the query table which Listing classes use. Moreover, each data field can have a tooltip, which is shown when the mouse hovers over the input field. The layout settings allow to apply custom CSS to any object field. WARNING Please note that renaming a field means the loss of data from the field in all objects using this class. See sub-pages of this page for detail documentation of different data types.
General Aspects
[ 0.08024042844772339, -0.12383443862199783, -0.08191084116697311, 0.2449534684419632, 0.11921112984418869, -0.23361843824386597, 0.0005235698190517724, -0.030857285484671593, -0.13571366667747498, 0.2149968147277832, -0.20982380211353302, 0.41699254512786865, 0.12467978149652481, 0.26560679...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Data_Types#default-values
Default values For datatypes which support default values (currently these are Input, Date, Datetime, Numeric, Checkbox, Select and Quantity Value) you can either specify a fixed default value or you can specify a default value generator service or class which can generate a dynamic default value. The data is persisted according to the following rules. No inheritance: default value is persisted to store/query table on create With inheritance and NO parent value: default value is persisted to store/query table on create With inheritance and existing parent value: no value is persisted to store table, inherited value is persisted to query table, inheritance is active A default value generator is a class which implements \Pimcore\Model\DataObject\ClassDefinition\DefaultValueGeneratorInterface. This class can generate a value based on the current data of an object. Have a look at Calculated Value for an overview of contextual information. If a default value generator is defined then it has a higher priority than a configured static default value. The decisions are made in the following order: default value generator. if defined the process stops here parent value if inheritance is enabled fixed default value
Default values
[ -0.3680725395679474, -0.3842437267303467, -0.03843172267079353, -0.09046471863985062, 0.10740071535110474, -0.36856961250305176, 0.16472163796424866, -0.08621975779533386, -0.16776633262634277, 0.3880716860294342, -0.01732228882610798, 0.4093344509601593, 0.12366341799497604, 0.28690215945...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Dynamic_Text_Labels#dynamic-text-labels
Dynamic Text Labels Similar to the CalculatedValue data type, it is possible to generate the Layout Text dynamically based on the current object and the label's context. There are two options for defining dynamic content: Providing a custom renderer class Using twig in template This is an alternative to the static text defined in the class definition. For all ways, the preview tab shows a preview of the generated content. If you are using object context in your content, then just drag & drop object on "Drag Object for Preview" field before checking the output in preview tab.
Dynamic Text Labels
[ -0.17828333377838135, -0.43901148438453674, -0.10078991949558258, 0.2985534071922302, 0.11852282285690308, -0.2923445701599121, 0.3450022339820862, 0.14583992958068848, -0.0036969545762985945, 0.32375386357307434, -0.23528394103050232, 0.33458662033081055, 0.14563603699207306, 0.3256560862...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Dynamic_Text_Labels#custom-renderer-class
Custom Renderer Class Let's consider the following example. It states that we want to use a custom renderer service which implements DynamicTextLabelInterface and in turn returns dynamic text string from renderLayoutText method. We also want to pass some additional data (some additional data :) in this example) to the rendering method. Here is an example for a rendering class. <?php namespace App\Helpers; use Pimcore\Model\DataObject\Concrete; class CustomRenderer implements DynamicTextLabelInterface { /** * @param string $data as provided in the class definition */ public function renderLayoutText(string $data, ?Concrete $object, array $params): string { $text = '<h1 style="color: #F00;">Last reload: ' . date('c') . '</h1>' . '<h2>Additional Data: ' . $data . '</h2>'; if ($object) { $text .= '<h3>BTW, my fullpath is: ' . $object->getFullPath() . ' and my ID is ' . $object->getId() . '</h3>'; } return $text; } } $data will contain the additional data from the class definition. In $params you will find additional information about the current context. For example: If the text label lives inside a field collection, $params will contain the name of the field collection (and of course the name of the label itself). The result will be as follows:
Custom Renderer Class
[ -0.19372572004795074, -0.17020627856254578, -0.10607218742370605, 0.3976813852787018, -0.13848131895065308, -0.6642321944236755, 0.4445132911205292, 0.09288632869720459, -0.245534747838974, 0.24559803307056427, 0.041839148849248886, 0.29355084896087646, 0.05593617632985115, 0.0080166375264...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Dynamic_Text_Labels#twig-&-preview
Twig & Preview It is possible to use Twig syntax inside htmleditor (Source Edit) and Renderer class. You can also check the generated output in preview tab. Following variables are available in twig context: object - current data object data - data provided to renderer defined in the class defintion Here is an example of Twig content in htmleditor source edit mode:
Twig & Preview
[ -0.48700547218322754, -0.18513737618923187, -0.15478181838989258, 0.06875093281269073, -0.02145182527601719, -0.22853298485279083, 0.24193397164344788, 0.2944880425930023, -0.2280670702457428, 0.24539893865585327, -0.06964493542909622, 0.3724973499774933, -0.11568143963813782, 0.2495118528...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Dynamic_Text_Labels#sandbox-restrictions
Sandbox Restrictions Dynamic Text renders user controlled twig templates in a sandbox with restrictive security policies for tags, filters & functions. Please use following configuration to allow more in template rendering: pimcore: templating_engine: twig: sandbox_security_policy: tags: ['if'] filters: ['upper'] functions: ['include', 'path']
Sandbox Restrictions
[ -0.11869935691356659, -0.47448617219924927, -0.12479895353317261, 0.17404668033123016, 0.41766855120658875, -0.5000724196434021, 0.1910053789615631, 0.2859695553779602, -0.11164047569036484, 0.22433772683143616, -0.24896539747714996, 0.46646615862846375, 0.15711438655853271, 0.381431609392...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Preview_Iframe#preview--iframe-panel
Preview / Iframe Panel Provide a URL and make use of the context paramater to render a response of your choice.
Preview / Iframe Panel
[ -0.2266731858253479, -0.3482927680015564, -0.16220790147781372, -0.19173434376716614, -0.1514860838651657, -0.24701444804668427, 0.39266377687454224, 0.3336576521396637, -0.045584097504615784, 0.18350690603256226, -0.03561192750930786, 0.036411043256521225, 0.07020201534032822, 0.141249582...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Preview_Iframe#class-configuration
Class Configuration Note that you can provide a freely selectable string that will be added to the context information. See the output of the example below.
Class Configuration
[ -0.2686040699481964, -0.20297163724899292, -0.18617680668830872, -0.0047477418556809425, 0.14749273657798767, -0.3119383752346039, 0.5161885619163513, -0.012505614198744297, -0.32679495215415955, 0.47508949041366577, 0.12852080166339874, 0.14513087272644043, 0.06977123767137527, 0.07425832...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Preview_Iframe#sample-controller-code
Sample Controller Code <?php namespace App\Controller; use Pimcore\Model\DataObject\Service; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; class IFrameController extends \Pimcore\Controller\FrontendController { /** * @Route("/iframe/summary") */ public function summaryAction(Request $request): Response { $context = json_decode($request->get("context"), true); $objectId = $context["objectId"]; $language = $context["language"]; // get the current editing data, not the saved one! $object = Service::getElementFromSession('object', $objectId); // If the object is opened the first time it is not in the session yet, // so we load the saved one if ($object === null) { $object = Service::getElementById('object', $objectId); } $response = '<h1>Title for language "' . $language . '": ' . $object->getTitle($language) . "</h1>"; $response .= '<h2>Context</h2>'; $response .= array_to_html_attribute_string($context); return new Response($response); } }
Sample Controller Code
[ -0.06194290891289711, -0.13809511065483093, -0.21702659130096436, 0.14462362229824066, 0.05270954966545105, -0.28209853172302246, 0.20098170638084412, 0.4207184314727783, -0.3365440368652344, 0.21492893993854523, -0.06776826828718185, 0.15322348475456238, 0.3123479187488556, 0.035761330276...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements/Preview_Iframe#object-editor
Object Editor
Object Editor
[ 0.1194768100976944, -0.16476671397686005, -0.2513883411884308, 0.10648822039365768, 0.0766981765627861, -0.26468536257743835, 0.1272651106119156, 0.03765318542718887, -0.1418323963880539, 0.42420709133148193, -0.09950972348451614, 0.4761624038219452, -0.30442044138908386, 0.253993123769760...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Layout_Elements#layout-elements
Layout Elements To structure object data layout-wise, there are 3 panel types and 4 other layout elements available. Data fields are always contained in a panel. Panels can be nested and thereby a data input interface tailored to the users's needs can be designed. The three available panel types are: Panel - a plain panel holding fields Region - a region panel able to hold nested panel's in its regions north, east, west and south Tabpanel - a panel holding further nested panels as tabs Moreover, within a panel fields can be put into the following layout Components Accordion Fieldset Field Container And last but not least there are three extra layout elements: Button - with a custom handler. Context of the handler js is the edit tab of the object. Text - to add minimally formatted text to an object layout. This can hold descriptions and hints which don't fit into a field's tooltip. Please note that since release 4.4.2 it is possible to generate this text dynamically. Please read this page for further details. IFrame - provide a URL and make use of the context parameter to render the response of your choice. Please read this page for further details. Pimcore uses Ext JS layout components for all object layout elements. For a deeper understanding of the layout elements, please have a look at the Ext JS documentation pages and examples.
Layout Elements
[ 0.06764820963144302, -0.6794061064720154, -0.06769004464149475, 0.32749176025390625, -0.031158551573753357, -0.21491633355617523, 0.15043488144874573, -0.0006212195148691535, -0.12629574537277222, 0.19785921275615692, -0.3913431167602539, 0.3968883752822876, 0.5034851431846619, 0.406208932...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Composite_Indices#composite-indices
Composite Indices Pimcore can create composite indices on object_query_*, object_store_*, object_localized_data_* and object_localized_query_* tables for you. Read this for more information about the database model.
Composite Indices
[ -0.45635920763015747, -0.1885359138250351, -0.16786988079547882, 0.3023184537887573, -0.0671221911907196, -0.07740691304206848, 0.21008999645709991, 0.08394206315279007, -0.19409385323524475, 0.17185842990875244, -0.3320949077606201, 0.10904239863157272, 0.028606360778212547, 0.31061702966...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Icons#custom-icons-for-objects
Custom Icons for Objects Pimcore allows you to define custom icons for objects. Either, icons can be the same for all objects of a class (via configuration in class) or objects depending on their data values can have different icons (see below). In addition to that, the tooltip of an object in object tree can be customized via admin style.
Custom Icons for Objects
[ -0.0888986736536026, -0.29474616050720215, -0.18921293318271637, 0.2583630383014679, -0.0017089068423956633, -0.2503400444984436, 0.09429274499416351, -0.005304316524416208, -0.2190399169921875, 0.22869111597537994, -0.10930347442626953, 0.5388345718383789, -0.04082481563091278, 0.07501314...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Icons#static-custom-icons-for-classes
Static Custom Icons for Classes Objects can be displayed in Pimcore with custom icons. This makes objects distinguish themselves visually based on the class they are based on. In the object tree the user can see on the first sight what an object should represent. The example below shows how custom icons are assigned to a class and how they are displayed in the object tree. It is easy for the user to see immediately which objects are of the type "News". Icons that come along with Pimcore by default can be found in <YOUR-DOMAN>/admin/misc/icon-list (backend session needed).
Static Custom Icons for Classes
[ -0.08703713119029999, -0.24851594865322113, -0.11318644136190414, 0.27059847116470337, 0.0992293581366539, -0.3207128942012787, 0.1503276377916336, 0.21005384624004364, -0.3494977653026581, 0.1465051770210266, -0.19607260823249817, 0.5202502012252808, -0.10868894308805466, 0.01339531037956...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Icons#icon-sizes
Icon Sizes As icons SVG graphics are recommended. If you use pixel graphics, the maximum size is 18x20 pixels.
Icon Sizes
[ -0.4550200402736664, -0.5515519380569458, -0.2604910135269165, 0.33758360147476196, 0.07920258492231369, -0.2237166315317154, 0.13607969880104065, 0.09963782131671906, -0.010985743254423141, 0.17884355783462524, 0.24022901058197021, -0.19096505641937256, -0.0010996331693604589, 0.154664158...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Icons#dynamically-define-custom-icons-and-style-in-object-tree-(adminstyle)
Dynamically define Custom Icons and Style in Object-Tree (AdminStyle) You can dynamically define custom icons based on the element. Read Dynamic Icons for details.
Dynamically define Custom Icons and Style in Object-Tree (AdminStyle)
[ -0.05225762724876404, -0.1624969244003296, -0.28356996178627014, 0.2382006049156189, 0.21174220740795135, -0.32687678933143616, 0.19898724555969238, 0.13451460003852844, -0.03705611824989319, 0.20395563542842865, 0.013577857986092567, 0.1927470564842224, -0.13976122438907623, 0.25550869107...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Layouts#custom-layouts
Custom Layouts It is possible to create customized layouts based on the main definition and override the settings concerning the visual aspects of the layout and data components. It is also possible to make a field editable, although it is marked as non-editable in the main layout. Custom layouts are available for all admin users and can be made available to standard users through the workspace settings. Security Note Custom layouts are not intended to restrict access to sensitive data in high-security scenarios. To define a custom layout, open the Custom Layout Editor through the Configure Custom Layouts button in the Classes editor. You can define as many layouts as you want. In the left panel, you will see the main definition. In the middle is the custom layout you are currently editing. And on the right, the specific settings for the selected field. You can modify all visual aspects of the field. Other settings concerning the data aspects are locked. You can drag and drop elements from the main layout to the custom layout tree, or you can add layout components using the context menu. Note that there is no need to add all data elements from the main layout to the custom layout. You can choose just as many as you need. This does not have any impact on your data! In the Data Objects editor, the layout can then be chosen via the reload button. Admin users will notice an extra layout called Main (Admin Mode), which is basically the same as the Main layout, except that invisible fields are shown, and non-editable fields are made editable again. This layout is available for admin users only. As mentioned above, custom layouts can be made available to standard users through the workspace settings in the user permissions. If no layout is selected for the given class, then the data will be presented using the main layout. Otherwise, the user will have the choice between the selected layouts.
Custom Layouts
[ 0.11371833831071854, -0.1690208464860916, -0.2064603716135025, 0.09252341091632843, -0.09959489107131958, -0.1544390320777893, 0.2942509949207306, 0.03581656143069267, 0.016354845836758614, 0.33852526545524597, -0.18213042616844177, 0.09989837557077408, 0.03903577849268913, 0.0964113771915...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#custom-views
Custom Views A custom view is an additional custom tree representing a subset of elements of the corresponding original tree. Custom views can be configured for Documents, Assets and Objects. To create or edit perspectives and custom views within the Pimcore backend UI use the perspective editor bundle. Security Note Perspectives and Custom Views are not intended to be used to restrict access to data An unlimited number of custom views can be created. Specify the tree type, root node and layout settings. Note that the ID is mandatory and must be unique! For a sample configuration file have a look at the sample configuration.
Custom Views
[ -0.124371737241745, -0.1237880289554596, -0.12680684030056, 0.15575416386127472, -0.32840731739997864, -0.22080907225608826, 0.029058989137411118, -0.06528139114379883, -0.31142571568489075, 0.04395889490842819, -0.4009913206100464, 0.33862704038619995, 0.19467438757419586, 0.1887570619583...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#the-configuration-file
The Configuration File Format and location of the custom view configuration depends on your environment. Per default the symfony-config is used. If you want to change the default behaviour, have a look at the environment configuration options.
The Configuration File
[ -0.064243845641613, -0.0689333900809288, -0.07205550372600555, -0.034844789654016495, -0.15538810193538666, -0.23401297628879547, 0.39762136340141296, -0.041039302945137024, 0.25244149565696716, 0.024220271036028862, -0.07971978187561035, 0.12536484003067017, 0.11788386106491089, 0.0245078...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#advanced-features--configurations
Advanced Features / Configurations
Advanced Features / Configurations
[ -0.07272260636091232, -0.924610435962677, -0.32670408487319946, 0.05885550379753113, -0.018829677253961563, -0.0009416328393854201, 0.15575957298278809, -0.17215487360954285, -0.389469176530838, 0.22254522144794464, -0.02922973223030567, 0.08366485685110092, -0.046051762998104095, 0.642647...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#additional-object-tree-including-condition-filter
Additional object tree including condition filter The main idea for this configuration is to add an additional object tree called Events having its root at /Events not showing the parent folder as its root only show events that have the "Salzburg" tag. Note Be aware: for tree pagination to work properly, there needs to be a parent node available. If you have more than a certain amount of child nodes at your root level, you might need to set "showroot" to true because of that. #var/config/custom-views/customviews.yaml pimcore: custom_views: definitions: 87705013-edb9-c9ec-0f5e-c3ee45ca4459: name: Events treetype: object position: right rootfolder: /Events showroot: false sort: 0 treeContextMenu: object: items: add: true addFolder: true importCsv: true cut: true copy: true paste: true delete: true rename: true reload: true publish: true unpublish: true searchAndMove: true lock: true unlock: true lockAndPropagate: true unlockAndPropagate: true changeChildrenSortBy: true classes: '' joins: [ { type: left, name: { ev: object_query_EV }, condition: 'objects.id = ev.oo_id', columns: { ev: tags } } ] id: 87705013-edb9-c9ec-0f5e-c3ee45ca4459 icon: /bundles/pimcoreadmin/img/flat-color-icons/vip.svg where: '' having: 'ev.tags LIKE "%%Salzburg%%"'
Additional object tree including condition filter
[ -0.17864616215229034, 0.027299635112285614, -0.17004866898059845, 0.4006502330303192, -0.08851652592420578, -0.27088889479637146, -0.24509570002555847, 0.45678678154945374, 0.08465905487537384, -0.08174029737710953, -0.3466215431690216, 0.2605445384979248, -0.15675190091133118, 0.229291155...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#additional-asset-tree-hiding-items-based-on-a-property
Additional asset tree hiding items based on a property use the /examples/panama as the root folder do not show the parent node position it on the left place it on the top and expand it hide assets which have the "HIDE" property set to true #var/config/custom-views/customviews.yaml pimcore: custom_views: definitions: 186632eb-5ad3-6ac6-61f8-7a75e64f2204: name: 'Panama Impressions' treetype: asset position: left rootfolder: /examples/panama showroot: false sort: -4 treeContextMenu: asset: items: add: hidden: false items: upload: true uploadCompatibility: true uploadZip: true addFolder: true rename: true copy: true cut: true paste: true pasteCut: true delete: true searchAndMove: true lock: true unlock: true lockAndPropagate: true unlockAndPropagate: true reload: true joins: [ { type: left, name: { meta: properties }, condition: "(meta.cid = assets.id AND meta.ctype = 'asset' AND name = 'HIDE')", columns: { hide: data } } ] icon: /bundles/pimcoreadmin/img/flat-color-icons/camera_identification.svg where: '' having: 'type = "folder" OR hide is NULL or hide != 1'
Additional asset tree hiding items based on a property
[ -0.04304075613617897, -0.05548767372965813, -0.24242763221263885, 0.4461446702480316, -0.023563170805573463, -0.14347121119499207, 0.16821789741516113, 0.47847703099250793, -0.2546626627445221, 0.013173811137676239, -0.2565985321998596, 0.4112273156642914, -0.04862569645047188, 0.018309675...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#document-tree-filtering-using-the-where-clause
Document tree filtering using the where clause The intention is to show the /en/Magazine (including the parent node on the right side) apply a simple filter which allows us to only show folders links pages which do not have the character 'g' in their key #var/config/custom-views/customviews.yaml pimcore: custom_views: definitions: c3da6659-c8b3-f3ed-2eda-70b2d3756730: name: Magazine treetype: document position: right rootfolder: /en/Magazine showroot: true sort: -12 treeContextMenu: document: items: add: true addSnippet: true addLink: true addEmail: true addHardlink: true addFolder: true paste: true pasteCut: true copy: true cut: true rename: true unpublish: true publish: true delete: true open: true convert: true searchAndMove: true useAsSite: true editSite: true removeSite: true lock: true unlock: true lockAndPropagate: true unlockAndPropagate: true reload: true icon: /bundles/pimcoreadmin/img/flat-color-icons/reading.svg where: "(type = 'folder' OR (type = 'page' and `key` NOT LIKE '%%g%%' OR type = 'link'))"
Document tree filtering using the where clause
[ -0.01248136442154646, -0.15901686251163483, -0.14431947469711304, 0.2638426125049591, 0.006695937365293503, -0.22802533209323883, -0.13676853477954865, 0.2552516758441925, -0.23649899661540985, -0.15219612419605255, -0.19712041318416595, 0.37196528911590576, -0.0177483931183815, -0.0795547...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_Views#customizing-the-tree-context-menu
Customizing the Tree Context Menu Allows you to hide certain context menu items via the customview's treeContextMenu configuration option. #var/config/custom-views/customviews.yaml pimcore: custom_views: definitions: 186632eb-5ad3-6ac6-61f8-7a75e64f2204: ... treeContextMenu: asset: items: add: hidden: false items: upload: true uploadCompatibility: true uploadZip: true addFolder: false rename: true copy: false #deny copy cut: false #deny cut paste: true pasteCut: true delete: true searchAndMove: true lock: false #deny lock unlock: true lockAndPropagate: true unlockAndPropagate: true reload: true ... There are keys for most of the menu items, including sub menu items. The notion is like indicated in the example configuration. Let's assume that we want to hide the "copy" option. The short way is this one: copy: false #the default is that all menu entries are visible copy: hidden: true
Customizing the Tree Context Menu
[ 0.0029577298555523157, -0.25498151779174805, -0.13717417418956757, 0.33015426993370056, -0.37700948119163513, -0.15436263382434845, -0.06779856979846954, 0.28858959674835205, -0.4998217523097992, 0.08473897725343704, -0.2538868486881256, 0.3470314145088196, 0.029796309769153595, 0.03616796...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Custom_View_Example#custom-view-example-configuration
Custom View Example Configuration #var/config/custom-views/87705013-edb9-c9ec-0f5e-c3ee45ca4459.yaml pimcore: custom_views: definitions: 87705013-edb9-c9ec-0f5e-c3ee45ca4459: name: Events treetype: object position: left rootfolder: /Events showroot: false sort: 0 treeContextMenu: object: items: add: true addFolder: true importCsv: true cut: true copy: true paste: true delete: true rename: true reload: true publish: true unpublish: true searchAndMove: true lock: true unlock: true lockAndPropagate: true unlockAndPropagate: true changeChildrenSortBy: true classes: '' joins: [ { type: left, name: { ev: object_query_EV }, condition: 'objects.id = ev.oo_id', columns: { ev: tags } } ] id: 87705013-edb9-c9ec-0f5e-c3ee45ca4459 icon: /bundles/pimcoreadmin/img/flat-color-icons/vip.svg where: '' having: 'ev.tags LIKE "%%Salzburg%%"'
Custom View Example Configuration
[ -0.2789798676967621, -0.1786600798368454, -0.1741030216217041, 0.4219600260257721, -0.02761691063642502, -0.10285976529121399, -0.014480690471827984, 0.26761236786842346, 0.023769600316882133, -0.051518142223358154, -0.19537238776683807, 0.39959874749183655, -0.07059064507484436, 0.2661360...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Inheritance#data-inheritance-and-parent-class
Data Inheritance and Parent Class Pimcore provides two sorts of inheritance. While data inheritance allows the inheritance of object data along the tree hierarchy of objects, the developer can modify the PHP class hierarchy with the parent class setting of object classes.
Data Inheritance and Parent Class
[ -0.265458345413208, -0.020097458735108376, -0.20981502532958984, 0.3997233808040619, 0.1550365686416626, -0.23389653861522675, -0.10591268539428711, -0.03231377527117729, -0.489845871925354, 0.20442642271518707, 0.01196993887424469, 0.11294901371002197, 0.049244482070207596, -0.16055728495...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Inheritance#data-inheritance
Data Inheritance A very important feature in connection with PIM is data inheritance. Data inheritance means, that objects of the same class can inherit data from their parent objects in the object tree. One use case is the storage of product data. Imagine, you have a group of products which have many attributes in common and differ in just a few attributes (for example size, color, ...). So you can create a parent product which stores all the common attributes. Then you add child products and specify attributes in which the products differ (size, color, ...). All other attributes they inherit from the common parent product. Data inheritance has to be enabled in the class definition like in the screen below: If data inheritance is enabled and an attribute of an object is empty, Pimcore tries to get this attribute from a parent object. This works only, if the parent object has the same class as the child object. Data inheritance between different classes is not supported. In the Pimcore backend, inherited values are visualized as in the screen below: they are grey and a bit transparent, and have a green marker in the upper left corner. With a click on this corner, one can open the source object of this specific attribute. Important Note regarding changing the inheritance flag If you toggle the inheritance flag after creating objects, the object_*_query* might contain wrong values even after saving the object again. Pimcore will disable the dirty detection if the class is newer than the object which should fix this issue. However, you can still call DataObject::disableDirtyDetection() before saving the object if you want to explicitely fix that. **Default Values Make sure that you understand the impacts of defining a default value which is described here To get the inherited values in the backend via code, you have to use the getter-methods of the attributes. By accessing the attributes directly, you will not get the inherited values. Bear in mind The complex data type field collections does not support inheritance. Getting values from an object without inheritance // Set the first argument to false so as not to inherit any values DataObject\Service::userInheritedValues(false, function() { // ... your code goes here // ... // ... });
Data Inheritance
[ -0.3690641522407532, -0.18072251975536346, -0.133175328373909, 0.37648236751556396, 0.16834962368011475, -0.47596096992492676, 0.07108163088560104, -0.12670758366584778, -0.4721095561981201, 0.37396499514579773, -0.19701138138771057, 0.4091986119747162, 0.0827636644244194, 0.02758209779858...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Inheritance#parent-class---class-inheritance
Parent Class - Class Inheritance Pimcore data objects support inheritance, just as any PHP object does. In Pimcore the class from which a specific data class inherits can be changed. By default, a data class inherits from Pimcore\Model\DataObject\Concrete, but if required otherwise, a data class can extend a different parent class. If the parent class should be changed, this needs to be specified in the class definition as shown in the screen below: Be Careful This is a very advanced feature and should only be used by very experienced developers who know what they are doing and what consequences it might have when the parent class is changed from Pimcore\Model\DataObject\Concrete to something else. In order to maintain all Pimcore functionalities, it has to be ensured that the special class used in the example above extends Pimcore\Model\DataObject\Concrete and that its methods don't override and clash in unexpected ways with existing methods of Pimcore\Model\DataObject\Concrete or any magic functions of Pimcore\Model\DataObject\Concrete or its parent classes. It is also possible to use class inheritance and traits for listing data object model.
Parent Class - Class Inheritance
[ -0.12649741768836975, 0.029577884823083878, -0.22657935321331024, 0.3441369831562042, 0.19791701436042786, -0.16448311507701874, 0.11520726978778839, -0.015326574444770813, -0.22719064354896545, 0.13763771951198578, -0.2507292926311493, 0.24289369583129883, 0.0021669501438736916, 0.0514274...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Inheritance#hooks-available-when-using-class-inheritance
Hooks available when using class inheritance Currently there's only one hook available. For using a hook you need to implement a certain interface in your custom parent class. Interface Description PreGetValueHookInterface Makes it possible to modify data before returning it to the caller. Hook is called at the beginning of every getter of a field.
Hooks available when using class inheritance
[ 0.041797228157520294, -0.40871334075927734, -0.22681309282779694, 0.06282204389572144, 0.040636200457811356, -0.4470614492893219, 0.04010234400629997, -0.007922313176095486, -0.010608452372252941, 0.284167617559433, -0.028238903731107712, 0.232331782579422, 0.15452662110328674, -0.10205132...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Inheritance#example:
Example: namespace Website\DataObject; use \Pimcore\Model\DataObject; class Special extends DataObject\Concrete implements DataObject\PreGetValueHookInterface { public function preGetValue(string $key): ?string { if ($key == "myCustomProperty") { return strtolower($object->myCustomProperty); } return null; } }
Example:
[ -0.146959125995636, -0.1105550080537796, -0.2105330228805542, 0.05590950697660446, 0.13745543360710144, -0.5212185978889465, -0.15427976846694946, 0.11636469513177872, -0.3493810296058655, 0.3642132878303528, 0.07865975052118301, 0.2544879615306854, -0.09170340746641159, 0.1469368636608123...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Inheritance#overriding-pimcore-models
Overriding Pimcore Models In addition to parent classes, it is also possible to override Pimcore object classes with custom classes and tell Pimcore to use the custom classes instead of the generated object classes. This can be done by using model overrides.
Overriding Pimcore Models
[ -0.18436774611473083, -0.09457351267337799, -0.13221988081932068, 0.06716436892747879, 0.16095414757728577, -0.12011399865150452, 0.19142115116119385, 0.12963038682937622, -0.24174177646636963, 0.15896789729595184, -0.23502099514007568, 0.3731943368911743, -0.044011469930410385, 0.18422004...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Interfaces_and_traits#using-interfaces-and-traits
Using Interfaces and Traits In some cases it could be helpful to let the generated PHP class for data objects implement interfaces or add some additional functions using traits.
Using Interfaces and Traits
[ -0.2094493806362152, -0.05128783732652664, -0.3148176372051239, 0.21955792605876923, 0.23852016031742096, -0.4360317885875702, 0.21191291511058807, 0.16348031163215637, 0.04562140256166458, 0.2972058355808258, 0.20353743433952332, 0.18394090235233307, -0.05432611331343651, 0.20449569821357...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Interfaces_and_traits#example
Example This example uses the demo project to show the usage of this features. We're extending the Cars class with methods to retrieve the transmission type as well as the amount of gears. This will be done by implementing an interface and a trait that adds the required methods.
Example
[ -0.08542675524950027, -0.38745278120040894, -0.1482970416545868, 0.3083251416683197, 0.07697642594575882, -0.07313094288110733, 0.1682039499282837, 0.07010545581579208, -0.2788943648338318, 0.4047214984893799, 0.13167165219783783, 0.37229251861572266, -0.1496710628271103, 0.135645180940628...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Interfaces_and_traits#create-the-interface
Create the interface <?php // src/Model/Product/TransmissionInterface.php namespace App\Model\Product; interface TransmissionInterface { public function getGearboxType(): ?string; public function getNumberOfGears(): ?int; }
Create the interface
[ -0.3441998362541199, -0.5228092074394226, -0.20489591360092163, 0.2945280373096466, 0.2160230576992035, -0.23692722618579865, 0.41412481665611267, 0.20085233449935913, 0.09671295434236526, 0.3288312554359436, 0.08255992829799652, 0.21946658194065094, -0.26898086071014404, 0.543420851230621...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Interfaces_and_traits#create-the-trait
Create the trait Returns a GearboxType and a number of gears. <?php // src/Traits/TransmissionTrait.php namespace App\Traits; trait TransmissionTrait { public function getGearboxType(): ?string { return "manual"; } public function getNumberOfGears(): ?int { return 5; } }
Create the trait
[ -0.20857389271259308, -0.6396910548210144, -0.15257811546325684, 0.4209683835506439, 0.2580626308917999, -0.13536866009235382, 0.1515698879957199, 0.3309587240219116, 0.041966769844293594, 0.3037179410457611, 0.20133642852306366, 0.21333104372024536, -0.23638220131397247, 0.177281513810157...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Interfaces_and_traits#use-it-with-cars-product-data
Use it with Cars product data Navigate to the Settings Settings -> Data Objects -> Classes -> Product Data -> Car Click on General Settings and paste your interface and trait path into Implements interface(s) and Use (traits) Save your changes It will generate the implements \App\Model\Product\TransmissionInterface and the use \App\Traits\TransmissionTrait; lines within the DataObject Class. // var/classes/DataObject/Car.php ... class Car extends \App\Model\Product\AbstractProduct implements \App\Model\Product\TransmissionInterface { use \App\Traits\TransmissionTrait; protected $classId = "CAR"; protected $className = "Car"; ...
Use it with Cars product data
[ -0.33611610531806946, -0.112706758081913, -0.1984633207321167, 0.2543809413909912, 0.3067621886730194, -0.23910991847515106, 0.3338489532470703, 0.23263564705848694, 0.13528010249137878, -0.020319072529673576, 0.4008334279060364, 0.3194006085395813, -0.09329672157764435, 0.4187531769275665...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#link-generator
Link Generator
Link Generator
[ -0.19698214530944824, -0.35167163610458374, -0.25363680720329285, 0.23929080367088318, 0.05361834168434143, -0.2765973210334778, 0.24579936265945435, 0.09308715164661407, 0.2982083261013031, 0.28206667304039, 0.07267297059297562, 0.18121390044689178, -0.1549590528011322, -0.015940351411700...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#summary
Summary Link Generators are used to dynamically generate web-links for objects and are automatically called when objects are linked in document link editables, link document types and object link tags. Additionally they are also enabling the preview tab for data objects. Link generators are defined on class level, there are two ways to do this. Either simply specify the class name or the name of a Symfony service (notice the prefix). services: # --------------------------------------------------------- # Link Generators for DataObjects # --------------------------------------------------------- App\Website\LinkGenerator\CategoryLinkGenerator: public: true App\Website\LinkGenerator\ProductLinkGenerator: public: true ...
Summary
[ -0.03500095754861832, 0.01912836730480194, -0.0121711241081357, 0.22606606781482697, 0.017954114824533463, -0.20989128947257996, 0.3525925874710083, 0.06182508543133736, 0.2430068701505661, 0.10516896843910217, 0.018643436953425407, 0.2163529396057129, -0.02805205248296261, -0.121801801025...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#sample-link-generator-implementation
Sample Link Generator Implementation <?php namespace App\Website\LinkGenerator; use App\Model\Product\AccessoryPart; use App\Model\Product\Car; use App\Website\Tool\Text; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\ProductInterface; use Pimcore\Model\DataObject; use Pimcore\Model\DataObject\ClassDefinition\LinkGeneratorInterface; use Pimcore\Model\DataObject\Concrete; use Pimcore\Bundle\EcommerceFrameworkBundle\Model\DefaultMockup; class ProductLinkGenerator extends AbstractProductLinkGenerator implements LinkGeneratorInterface { public function generate(Concrete $object, array $params = []): string { if (!($object instanceof Car || $object instanceof AccessoryPart)) { throw new \InvalidArgumentException('Given object is no Car'); } return $this->doGenerate($object, $params); } public function generateWithMockup(ProductInterface $object, array $params = []): string { return $this->doGenerate($object, $params); } protected function doGenerate(ProductInterface $object, array $params): string { return DataObject\Service::useInheritedValues(true, function () use ($object, $params) { return $this->pimcoreUrl->__invoke( [ 'productname' => Text::toUrl($object->getOSName() ? $object->getOSName() : 'product'), 'product' => $object->getId(), 'path' => $this->getNavigationPath($object->getMainCategory(), $params['rootCategory'] ?? null), 'page' => null ], 'shop-detail', true ); }); } } Note: If you want to support mockups or arbitrary objects you can change the typehint to: public function generate(object $object, array $params = []): string { //... } The link generator will receive the referenced object and additional data depending on the context. This would be the document (if embedded in a document), the object if embedded in an object including the tag or field definition as context. Example: public function generate(Concrete $object, array $params = []): string { if (isset($params['document']) && $params['document'] instanceof Document) { // param contains context information $documentPath = $params['document']->getFullPath(); } ... }
Sample Link Generator Implementation
[ -0.2286028414964676, -0.2345554679632187, -0.16952843964099884, 0.22496776282787323, -0.001439780811779201, -0.3678815960884094, 0.23898297548294067, 0.1942605823278427, -0.25679993629455566, 0.0069829197600483894, 0.07087872922420502, 0.648520827293396, 0.06627105921506882, 0.143325030803...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#example-document
Example Document $d = Document\Link::getById(203); echo($d->getHref()); would produce the following output /en/shop/Products/Cars/Sports-Cars/Jaguar-E-Type~p9
Example Document
[ -0.031384460628032684, -0.3416660726070404, -0.2137991189956665, 0.2904968559741974, -0.13779602944850922, -0.001937490189447999, 0.2916545867919922, 0.4456470012664795, 0.11589760333299637, 0.3193897604942322, 0.03302696719765663, 0.07545216381549835, 0.13708139955997467, -0.0591537766158...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#use-in-views
Use in Views
Use in Views
[ -0.0145852230489254, -0.38923245668411255, -0.34366121888160706, -0.0528431236743927, 0.07158198952674866, -0.13823243975639343, 0.31367814540863037, 0.01370297558605671, 0.23856577277183533, 0.035261038690805435, 0.02078699693083763, 0.1890823245048523, -0.07664576172828674, 0.20929911732...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#path()--url()
path() / url() <ul class="foo"> {% for car in carList %} <li><a href="{{ path(car) }}">{{ car.getName() }}</a></li> {% endfor %} </ul>
path() / url()
[ 0.26511064171791077, -0.38045069575309753, -0.2252623736858368, 0.1740824431180954, 0.19858112931251526, -0.1770942658185959, 0.18177799880504608, 0.09475608915090561, 0.04833050072193146, 0.03969184309244156, 0.1320408284664154, 0.23751240968704224, -0.17952501773834229, -0.02811478078365...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Link_Generator#pimcoreurl
pimcoreUrl <ul class="foo"> {% for car in carList %} <li><a href="{{ path('pimcore_element', {'element': car}) }}">{{ car.getName() }}</a></li> {% endfor %} </ul>
pimcoreUrl
[ 0.09521212428808212, -0.37944281101226807, -0.2351926863193512, 0.23903609812259674, 0.17344370484352112, -0.26034605503082275, 0.11292185634374619, 0.005385822616517544, -0.10591382533311844, 0.10830283164978027, 0.08964165300130844, 0.4084579646587372, -0.11330132931470871, 0.09783976525...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Locking_Fields#locking-fields
Locking Fields Sometimes it's useful that a field cannot be modified/deleted in the class editor. Especially if a class is created by a plugin. Pimcore offers the possibility to lock a field programmatically, you can call the method setLocked() on every Pimcore\Model\DataObject\ClassDefinition\Data object.
Locking Fields
[ -0.0325402095913887, 0.06774842739105225, -0.16834984719753265, -0.07056105881929398, 0.13941556215286255, -0.3013564646244049, 0.21945661306381226, 0.07954974472522736, -0.21314795315265656, 0.39932942390441895, -0.01207785401493311, 0.44929006695747375, -0.10550366342067719, 0.0723201930...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Locking_Fields#example
Example The following example will lock every field inside the class with the ID 7. $class = DataObject\ClassDefinition::getById(7); $fields = $class->getFieldDefinitions(); foreach ($fields as $field) { $field->setLocked(true); } $class->save();
Example
[ -0.19722333550453186, 0.04044102504849434, -0.14638477563858032, 0.1950557678937912, -0.06470979750156403, -0.04186556115746498, 0.3884739875793457, 0.26970329880714417, 0.19869805872440338, 0.13148801028728485, 0.018626336008310318, 0.12667633593082428, -0.11202828586101532, -0.2213571518...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Path_Formatter#path-formatter
Path Formatter
Path Formatter
[ -0.0961860939860344, -0.28436279296875, -0.1918271780014038, 0.18209438025951385, 0.22322970628738403, -0.5537129640579224, 0.28119200468063354, 0.06634596735239029, -0.3319432735443115, 0.21940092742443085, 0.12810038030147552, 0.47519630193710327, -0.5033943057060242, 0.21242913603782654...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Path_Formatter#summary
Summary Allows you to show a user friendly "object information' instead of technical path in Pimcore data types such as Many-To-One, Many-To-Many (Object) etc. Uses Ajax to request nice path info on demand (i.e. after rendering)
Summary
[ -0.2644222378730774, -0.4826796352863312, -0.14624272286891937, 0.05851361155509949, 0.07442605495452881, -0.3134204149246216, -0.07193201780319214, 0.2580491900444031, -0.4869019091129303, 0.16464829444885254, -0.08372951298952103, 0.29001548886299133, 0.18889135122299194, 0.3957847356796...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Path_Formatter#example
Example In this example, we want to display the asset metadata title of the target asset.
Example
[ -0.033311810344457626, -0.3560742437839508, -0.22913295030593872, 0.11254464834928513, 0.0018191057024523616, -0.057161346077919006, 0.29805392026901245, 0.35468411445617676, -0.2781832814216614, 0.32002612948417664, -0.09517724812030792, 0.34752658009529114, 0.08799584209918976, -0.072825...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Path_Formatter#configuration-via-class-editor
Configuration via class editor Just specify the formatter service in the class editor.
Configuration via class editor
[ -0.10371794551610947, -0.19897349178791046, -0.12446870654821396, -0.18735207617282867, 0.1884879320859909, -0.2816692888736725, 0.4817367196083069, 0.08814605325460434, -0.3505288064479828, 0.44401904940605164, -0.004798964597284794, 0.2616461515426636, -0.08568314462900162, 0.24127234518...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Path_Formatter#sample-formatter-class
Sample Formatter Class <?php namespace App\PathFormatter; use Pimcore\Model\Asset; use Pimcore\Model\Element\ElementInterface; use Pimcore\Model\DataObject\BlogArticle; use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\ClassDefinition\PathFormatterInterface; use Pimcore\Model\DataObject\Concrete; use Pimcore\Model\DataObject\News; class TheFormatter implements PathFormatterInterface { /** * @param array $result containing the nice path info. Modify it or leave it as it is. Pass it out afterwards! * @param ElementInterface $source the source object * @param array $targets list of nodes describing the target elements * @param array $params optional parameters. may contain additional context information in the future. to be defined. * * @return array list of display names. */ public function formatPath(array $result, ElementInterface $source, array $targets, array $params): array { /** @var $fd Data */ $fd = $params["fd"]; $context = $params["context"]; foreach ($targets as $key => $item) { $newPath = $item["fullpath"] . " - " . time(); if ($context["language"]) { $newPath .= " " . $context["language"]; } if ($item["type"] == "object") { $targetObject = Concrete::getById($item["id"]); if ($targetObject instanceof News) { $newPath = $targetObject->getTitle() . " - " . $targetObject->getShortText(); } else if ($targetObject instanceof BlogArticle) { $newPath = $targetObject->getTitle(); } } elseif ($item["type"] == "asset") { $asset = Asset::getById($item["id"]); if ($asset) { $title = $asset->getMetadata("title"); if (!$title) { $title = "this guy does not have a title, use " . $newPath . " instead"; } if ($fd instanceof Data\ManyToManyRelation) { $newPath = '<img src="' . $asset . '" style="width: 25px; height: 18px;" />' . $title; } else { $newPath = $title; } } } // don't forget to use the same key, otherwise the matching doesn't work $result[$key]= $newPath; } return $result; } } Note regarding batch assignment The containerType will be batch and the object ID will be the folder ID.
Sample Formatter Class
[ -0.2851423919200897, -0.1517440527677536, -0.24258111417293549, 0.248308926820755, 0.1855832189321518, -0.4062279760837555, 0.3510085940361023, 0.30261844396591187, -0.3875325322151184, 0.19675730168819427, 0.05316731333732605, 0.36207935214042664, -0.16465888917446136, 0.2768152356147766,...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Preview_Generator#preview-generator
Preview Generator
Preview Generator
[ -0.3881782591342926, -0.17849482595920563, -0.18138445913791656, 0.19124725461006165, -0.008008542470633984, -0.2204006463289261, 0.16261111199855804, 0.3777763247489929, -0.09800922125577927, 0.4289732575416565, 0.01964016817510128, 0.14762310683727264, -0.3322337567806244, 0.265862941741...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Preview_Generator#summary
Summary Preview Generators provide services to get more control over the preview tab. They provide a UI component to pass additional parameters to a URL-generator. Providers need to implement: \Pimcore\Model\DataObject\ClassDefinition\PreviewGeneratorInterface As of Pimcore 10.6, a default implementation of a PreviewGenerator is provided. You only need to add a link generator. The generated URL will then be used for the preview. Parameters returned in the getParams method will be rendered as a select box. Whatever the user chooses will be passed to the generatePreviewUrl method. Provide a Preview Generator within the Class settings:
Summary
[ -0.27521076798439026, -0.00033837920636869967, 0.023751525208353996, -0.017734527587890625, -0.057805199176073074, -0.32760703563690186, 0.194926917552948, 0.14763318002223969, -0.2101556658744812, 0.19745737314224243, -0.2403845489025116, 0.5354190468788147, 0.10220088809728622, -0.043030...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Preview_Generator#sample-previewprovider-implementation
Sample PreviewProvider Implementation namespace App\Service\PreviewParamProvider; use App\Website\LinkGenerator\ProductLinkGenerator; use Pimcore\Model\DataObject\ClassDefinition\PreviewGeneratorInterface; use Pimcore\Model\DataObject\Concrete; class ProductPreviewParamProvider implements PreviewGeneratorInterface { protected ProductLinkGenerator $productLinkGenerator; public function __construct(ProductLinkGenerator $productLinkGenerator) { $this->productLinkGenerator = $productLinkGenerator; } public function generatePreviewUrl(Concrete $object, array $params): string { $additionalParams = []; foreach($this->getPreviewConfig($object) as $paramStore) { $paramName = $paramStore['name']; if($paramValue = $params[$paramName]) { $additionalParams[$paramName] = $paramValue; } } return $this->productLinkGenerator->generate($object, $additionalParams); } public function getPreviewConfig(Concrete $object): array { return [ [ 'name' => '_locale', 'label' => 'Locale', 'values' => [ 'English' => 'en', 'German' => 'de' ], 'defaultValue' => 'en' ], [ 'name' => 'otherParam', 'label' => 'Other', 'values' => [ 'Label Text' => 'value', 'Option #2' => 2, 'Custom Option' => 'custom' ], 'defaultValue' => 'value' ] ]; } }
Sample PreviewProvider Implementation
[ -0.3804250955581665, -0.13256466388702393, -0.18569815158843994, 0.11008041352033615, -0.008599242195487022, -0.40822362899780273, 0.2334873229265213, 0.31708505749702454, -0.052441757172346115, 0.16314412653446198, -0.08484353125095367, 0.48314645886421204, 0.025515150278806686, 0.1523838...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Variants#object-variants
Object Variants The best way to show the use and function of object variants is via a use case: Your goal is to store lots of products in Pimcore. Many of these products are variants of each other, for example a yellow t-shirt, a blue t-shirt, a red t-shirt etc. Most of the t-shirts' attributes have the same values and they just differ in color and EAN code. One way to achieve this is to make a generic t-shirt object and then create for each variant a child object within the tree which inherits most attributes and sets only those which differ. This approach works fine, but if you have dozens or even hundreds of variants, your object tree becomes quite big and confusing. This is where object variants come in. Basically, they are just objects which you can configure to be not shown in the object tree. In the tree, you just create the generic t-shirt. For each variant of this t-shirt, you create an object variant. While you can choose variants to not be shown in the tree, you will nevertheless be able to edit them via an own tab within the object editor. The only difference between objects and variants in behaviour is that you cannot add an object of another class below a variant. So, you can create hundreds of object variants without blowing your object tree. As the normal object grid, the object variant grid supports paging, filtering, hiding of columns and visualization of inherited values. So even a big number of variants should be manageable.
Object Variants
[ -0.028480272740125656, -0.44213059544563293, -0.12349694222211838, 0.2536708116531372, 0.1180640235543251, -0.4186244308948517, 0.09446492046117783, -0.21968697011470795, -0.20975495874881744, 0.41357794404029846, -0.1843009889125824, 0.551815927028656, -0.0935535579919815, 0.2587746977806...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Variants#create-and-organize-object-variants
Create and organize Object Variants To use object variants, they have to be activated in the class definition first. Object variants only make sense, if inheritance is activated. Therefore, inheritance is a requirement for object variants. Once they are activated, the object editor has an additional tab 'Variants'. There, all variants of the current object are shown in a grid. Via buttons object variants can be created, opened and deleted. To create object variants via code, just create a normal object, set as parent the generic t-shirt and set the object type to DataObject::OBJECT_TYPE_VARIANT. $objectX = new DataObject\Product(); $objectX->setParent(DataObject\Product::getById(362603)); $objectX->setKey("variantname"); $objectX->setColor("black"); $objectX->setType(DataObject::OBJECT_TYPE_VARIANT); $objectX->save();
Create and organize Object Variants
[ 0.12201380729675293, -0.3512952923774719, -0.07313884794712067, 0.29466569423675537, -0.09784404188394547, -0.1784048080444336, 0.42615389823913574, 0.06067531555891037, -0.13137708604335785, 0.39189213514328003, -0.0342111811041832, 0.5494723916053772, -0.34213340282440186, 0.345808476209...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Variants#query-object-variants
Query Object Variants
Query Object Variants
[ 0.10644915699958801, -0.5085228681564331, -0.2941198945045471, 0.43357160687446594, -0.2528930604457855, -0.44286346435546875, 0.02137570269405842, 0.03718440234661102, -0.05823656544089317, 0.1250186264514923, -0.1628154069185257, 0.19760140776634216, -0.06379052251577377, 0.1458238959312...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Variants#get-all-object-variants-of-an-object
Get all Object Variants of an object Getting all variants of an object is quite simple. Just call getChildren and pass the wanted object types as an array. If only variants should be returned use following line. $objectX->getChildren([DataObject::OBJECT_TYPE_VARIANT]); By default, getChildren delivers objects, variants, and folders.
Get all Object Variants of an object
[ -0.27628883719444275, -0.36361998319625854, -0.16098223626613617, 0.6309903264045715, 0.017118189483880997, -0.1771143227815628, -0.04376108944416046, 0.4730318784713745, -0.1345050036907196, 0.2733081877231598, -0.29698053002357483, 0.424925833940506, -0.30523011088371277, 0.0765761137008...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings/Variants#object-variants-in-object-lists
Object Variants in Object Lists Similar to getChildren, the object list objects now have an object type property, which defines the object types to deliver. Per default objects, variants and folders are delivered. To deliver object variants, use one of the following code snippets: $list = new DataObject\Product\Listing(); $list->setObjectTypes([DataObject::OBJECT_TYPE_VARIANT]); $list->load(); // or DataObject\Product::getList([ "objectTypes" => [DataObject::OBJECT_TYPE_VARIANT] ]); If you want regular objects and variants, you should use: $list = new DataObject\Product\Listing(); $list->setObjectTypes([DataObject::OBJECT_TYPE_VARIANT,DataObject::OBJECT_TYPE_OBJECT]); $list->load();
Object Variants in Object Lists
[ 0.041698798537254333, -0.3196149468421936, -0.17834743857383728, 0.5389918684959412, 0.09214673191308975, -0.2052292823791504, 0.008407415822148323, 0.07329520583152771, 0.07056903839111328, 0.11647896468639374, -0.2513621151447296, 0.3848857879638672, -0.18044134974479675, 0.0745190605521...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings#additional-class-settings
Additional Class Settings On class level, there are multiple additional settings and features available which influence the appearance and behaviour of Pimcore. These can be either configured in the Pimcore backend or via code by a developer.
Additional Class Settings
[ -0.10802561044692993, -0.29957693815231323, -0.14709381759166718, 0.284305602312088, 0.284444123506546, -0.2596840262413025, 0.220111683011055, 0.07427553087472916, -0.49035578966140747, 0.41615670919418335, -0.0666191577911377, 0.37173593044281006, 0.1843094825744629, 0.13057304918766022,...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes/Class_Settings#these-features-include:
These features include: Composite Indices Data Inheritance and Parent Class Object Variants Custom Icons for objects Custom Layouts Custom Views Locking Fields Path Formatter Link Generator Type Declaration
These features include:
[ -0.19861412048339844, -0.5214117765426636, -0.2683776021003723, 0.15235033631324768, 0.021816369146108627, 0.1483841985464096, 0.33186933398246765, -0.06415197998285294, -0.054457858204841614, 0.08673496544361115, -0.025822201743721962, 0.12146411091089249, -0.0886036679148674, 0.485543221...
https://pimcore.com/docs/platform//Pimcore/Objects/Object_Classes#object-classes
Object Classes To get started with Pimcore objects, classes must be defined. In Create A First Project you can see the first steps how to create objects and classes. Defining a class consists of two parts: defining the attributes of the object and defining the layout for the object editor. Layout object properties can be grouped into panels, which incorporate the layout areas north, east, west, south and center and additionally they can be positioned into tab panels. This allows logical structuring of object attributes into smaller units of data belonging together. It depends on the use case how data should be grouped and structured. Common applications are tabs/groups for different languages or logical groups like basic data, media, sales data, etc. In addition to the main editor layout, Custom Layouts for different views on the object data can be defined. To define a class, the menu Settings -> Data Objects -> Classes needs to be used in the Pimcore toolbar menu. The class name has to be a valid PHP class name. After creating a new class, the class attributes and layout can be built. Add title field to classdefinitions, where you can add a translation key like app.classes.product which is used for translations in your translation file. Class attributes are defined from a set of predefined data types. These data types define not only the type of data such as text, number, image, reference to another object etc. but also how data input can be achieved and how data is accessed. Each data type comes with an input widget. For instance, the text input data type comes with a simple text field, the image data type comes with a drop area to which a user can drag and drop an image. For detailed documentation about these data types see Data Types. Also have a look at Layout Elements for information about the layout elements and Class Settings for further details and features of Pimcore classes like inheritance, variants, preview, custom layouts, etc.
Object Classes
[ 0.2036239057779312, -0.06094122678041458, -0.08555424958467484, 0.3192785084247589, 0.08385857194662094, -0.20321384072303772, 0.1805153787136078, -0.036589231342077255, -0.4587112069129944, 0.40865767002105713, 0.009864234365522861, 0.3098945915699005, 0.16167883574962616, 0.1705207824707...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#working-with-objects-via-php-api
Working With Objects via PHP API Pimcore provides an object orientated PHP API to work with Objects. There are several generic functionalities provided by Pimcore and for each Pimcore object class Pimcore generates corresponding PHP classes for working with these objects via a comfortable PHP API and take full advantage of an IDE (e.g. code completion etc.).
Working With Objects via PHP API
[ -0.11660341173410416, -0.09404904395341873, -0.21601274609565735, 0.18672685325145721, -0.08479655534029007, -0.3030904531478882, 0.013314241543412209, 0.07456458359956741, -0.2861298620700836, 0.2590964138507843, -0.04492846503853798, 0.39093711972236633, 0.010038090869784355, 0.326784670...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#crud-operations
CRUD Operations The following code snippet indicates how to access, create and modify an object programmatically: <?php use \Pimcore\Model\DataObject; // Create a new object $newObject = new DataObject\Myclassname(); $newObject->setKey(\Pimcore\Model\Element\Service::getValidKey('New Name', 'object')); $newObject->setParentId(123); $newObject->setName("New Name"); $newObject->setDescription("Some Text"); // the optional parameter allows you to provide additional info // currently supported: // * versionNote: note added to the version (see version tab) $newObject->save(["versionNote" => "my new version"]); //getting objects $myObject = DataObject\Myclassname::getById(167); //reading data $myObject->getName(); $myObject->getDescription(); // it's also possible to get an object by an foreign ID $city = DataObject\City::getByZip(5020,1); // you can also get an object by id where you don't know the type $object = DataObject::getById(235); // or obtain an object by path $object = DataObject::getByPath("/path/to/the/object"); // or get data objects matching a defined set of object types (default is to fetch data objects and variants) $product = DataObject\Product::getByColor('purple', 1, 0, [Product::OBJECT_TYPE_VARIANT]); //updating and saving objects $myObject->setName("My Name"); $myObject->save(); //deleting objects $city->delete(); When using your generated classes in the code, the classname always starts with a capital letter. Example-Classname: product PHP-Class: DataObject\Product  
CRUD Operations
[ -0.10745745897293091, 0.05910962447524071, -0.22165927290916443, 0.1884978860616684, -0.03906578943133354, -0.4390445649623871, 0.0948290079832077, 0.016710784286260605, -0.40826985239982605, 0.3705246150493622, -0.23092173039913177, 0.5010688304901123, 0.1427738070487976, 0.08287651091814...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#object-listings
Object Listings Once data is available in a structured manner, it can not only be accessed more conveniently but also be filtered, sorted, grouped and displayed intuitively by the use of an object listing. Moreover, data can be exported very easily not only programmatically but also through the Pimcore object csv export. Object listings are a simple way to retrieve objects from Pimcore while being able to filter and sort data along that process. Object listings also come with a built-in paginator that simplifies the display of results in a paged manner. When working with object listings, user defined routes come in handy while implementing object detail views. User defined routes allow directing requests to certain detail pages, even though the request does not portray the path of a document, but matches a certain route. For more information have a look at URLs based on Custom Routes. An object listing class is created automatically for each class defined in Pimcore. Objects for the class Myobject are retrieved through a listing as in the following example: <?php use \Pimcore\Model\DataObject; $entries = new DataObject\Myclassname\Listing(); $entries->setOffset($offset); $entries->setLimit($perPage); $entries->setOrderKey("date"); $entries->setOrder("desc"); $entries->setCondition("name LIKE ?", ["%bernie%"]); // use prepared statements! Mysqli only supports ? placeholders // or $entries->setCondition("name LIKE :name", ["name" => "%bernie%"]); // With PDO_Mysql you can use named parameters // to add param to the condition (until build 181 this cannot be used with setCondition in the same listing, you should use setCondition OR addConditionParam but not both) $entries->addConditionParam("city = ?", "New York", "AND"); // concatenator can be AND or OR //use array bindings for prepared statements $entries->setCondition("city IN (?)", [["New York", "Chicago"]]); // or $entries->setCondition("city IN (:cities)", ["cities" => ["New York", "Chicago"]]); // named parameters //if necessary you can of course custom build your query $entries->setCondition("name LIKE " . $entries->quote("%bernie%")); // make sure that you quote variables in conditions! // some data types support direct filtering, which can be verified via 'isFilterable()' method on field definition: if ($entries->getClass()->getFieldDefinition('fieldname e.g. name or age or city')->isFilterable()) { $entries->filterByName('Jan'); // filters for name='Jan' $entries->filterByAge(18, '>='); // filters for age >= 18 $entries->filterByCity([['New York', 'Chicago']], 'IN (?)'); // filters for city IN ('New York','Chicago') } foreach ($entries as $entry) { $entry->getName(); } // there is also a shorthand eg.: $items = DataObject\Myclassname::getList([ "offset" => $offset, "limit" => $perPage, "orderKey" => "date", "order" => "desc" ]); // order by multiple columns $items = DataObject\Myclassname::getList([ "offset" => $offset, "limit" => $perPage, "orderKey" => ["date", "name"], "order" => "desc" ]); // with different directions $items = DataObject\Myclassname::getList([ "offset" => $offset, "limit" => $perPage, "orderKey" => ["name", "date"], "order" => ["asc","desc"] ]); // with random order $items = new DataObject\PhoneProduct\Listing(); $items->setOrderKey("RAND()", false); foreach ($items as $item) { echo $item . "<br />"; // output the path of the object } // with subselect in order $items = new DataObject\PhoneProduct\Listing(); $items->setOrderKey("(SELECT id FROM sometable GROUP BY someField)", false);
Object Listings
[ -0.18459807336330414, -0.036949340254068375, -0.2049548327922821, 0.21333326399326324, -0.19628123939037323, -0.22443588078022003, -0.06694712489843369, 0.2930490970611572, -0.32255029678344727, 0.3020628094673157, -0.27487650513648987, 0.26551803946495056, 0.0524042546749115, 0.0423219501...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#using-prepared-statement-placeholders-and-variables
Using prepared statement placeholders and variables The syntax is similar to that from the Zend Framework described here. <?php use \Pimcore\Model\DataObject; $entries = new DataObject\Myclassname\Listing(); $entries->setCondition("name LIKE ?", "%bernie%"); $entries->load(); foreach($entries as $entry) {...} // using more variables / placeholders $entries = new DataObject\Myclassname\Listing(); $entries->setCondition("name LIKE ? AND date > ?", ["%bernie%", time()]); $entries->load(); foreach($entries as $entry) {...} // using named placeholders (recommended) $entries = new DataObject\Myclassname\Listing(); $entries->setCondition("name LIKE :name AND date > :date", ["name" => "%bernie%", "date" => time()]); $entries->load();
Using prepared statement placeholders and variables
[ -0.28414756059646606, -0.085565485060215, -0.277873158454895, -0.005611836444586515, 0.05058686435222626, -0.16829408705234528, 0.08952987194061279, 0.334007203578949, -0.04528838396072388, 0.07030835002660751, -0.03650425747036934, 0.1930358111858368, 0.030822372063994408, -0.093904949724...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#conditions-on-localized-fields
Conditions on localized fields Following code will only search the EN value of the field name. <?php $entries = new \Pimcore\Model\DataObject\Myclassname\Listing(); $entries->setLocale("en"); $entries->setCondition("name LIKE :name", ["name" => "%term%"]); // name is a field inside a localized field container
Conditions on localized fields
[ 0.02184869535267353, 0.04635496810078621, -0.15152974426746368, -0.14012746512889862, 0.061463404446840286, -0.4252209961414337, 0.10327445715665817, 0.46160879731178284, -0.06371483206748962, 0.043075885623693466, -0.1796911656856537, 0.10688398778438568, 0.18608784675598145, 0.0630299225...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#disable-localized-fields-in-listings
Disable Localized Fields in listings Sometimes you don't want to have localized data on the listings (condition & order by). For this particular case you can disable localized fields on your listing (the objects in the list will still include the localized fields). Conditions and order by statements on localized fields are then not possible anymore. <?php $entries = new \Pimcore\Model\DataObject\Myclassname\Listing(); $entries->setIgnoreLocalizedFields(true); $entries->load();
Disable Localized Fields in listings
[ -0.08920739591121674, 0.010209658183157444, -0.19884848594665527, 0.14881829917430878, 0.2630922198295593, -0.3082886338233948, 0.07301732897758484, 0.3193025290966034, 0.06726907193660736, 0.26268333196640015, -0.16859222948551178, 0.18659405410289764, 0.16327038407325745, -0.001361088594...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#get-objects-matching-a-value-of-a-property
Get Objects matching a value of a property Often it's very useful to get a listing of objects or a single object where a property is matching exactly one value. This is especially useful to get an object matching a foreign key, or get a list of objects with only one condition. $result = DataObject\ClassName::getByMyfieldname($value, ['limit' => $limit, 'offset' => $offset]); // or object variants matching a value $result = DataObject\ClassName::getByMyfieldname($value, ['limit' => $limit, 'offset' => $offset, 'objectTypes' => [DataObject::OBJECT_TYPE_VARIANT]]); // or for localized fields $result = DataObject\ClassName::getByMyfieldname($value, ['locale' => $locale, 'limit' => $limit, 'offset' => $offset]); // or object variants matching a value in localized fields $result = DataObject\ClassName::getByMyfieldname($value, ['locale' => $locale, 'limit' => $limit, 'offset' => $offset, 'objectTypes' => [DataObject::OBJECT_TYPE_VARIANT]]); // or object variants and objects matching a value in localized fields $result = DataObject\ClassName::getByMyfieldname($value, ['locale' => $locale, 'limit' => $limit, 'offset' => $offset, 'objectTypes' => [DataObject::OBJECT_TYPE_VARIANT, DataObject::OBJECT_TYPE_OBJECT]]); If you set no limit, a list object containing all matching objects are returned. If the limit is set to 1 the first matching object is returned directly (without listing). Only published objects are return. Alternatively you can pass an array as second parameter which will be applied to the object listing. $result = DataObject\ClassName::getByMyfieldname($value, ['limit' => 1,'unpublished' => true]);
Get Objects matching a value of a property
[ -0.18570759892463684, -0.1570310741662979, -0.22484026849269867, 0.38824862241744995, -0.16546958684921265, -0.4472895860671997, -0.042062170803546906, 0.5033400058746338, -0.09000144153833389, 0.39664584398269653, 0.07828478515148163, 0.22152478992938995, -0.09816574305295944, -0.01308040...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#examples
Examples <?php use \Pimcore\Model\DataObject; // get a list of cities in Austria $list = DataObject\City::getByCountry("AT"); foreach ($list as $city) { // do something with the cities $city->getZip(); ... } // get a city by zip $city = DataObject\City::getByZip(5020, 1); $city->getZip(); // do something with the city // get the first 10 cities in Austria $list = DataObject\City::getByCountry("AT", 10); foreach ($list as $city) { // do something with the cities $city->getZip(); }
Examples
[ -0.4087599813938141, -0.15434427559375763, -0.35803765058517456, 0.2738291621208191, -0.05034293979406357, -0.16651597619056702, 0.14411625266075134, 0.23630736768245697, 0.05967576801776886, 0.34788426756858826, -0.13158997893333435, 0.4075632393360138, 0.2235468626022339, 0.1031764596700...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#get-an-object-listobject-by-localized-fields
Get an Object List/Object by Localized Fields $list = DataObject\News::getByLocalizedfields($fieldName, $value, $locale, $limit | array('limit' => $limit, 'offset' => $offset, 'unpublished' => $unpublished)); // or $list = DataObject\News::getByFieldName($value, $locale, $limit | array('limit' => $limit, 'offset' => $offset, 'unpublished' => $unpublished));
Get an Object List/Object by Localized Fields
[ 0.01182080339640379, -0.07819082587957382, -0.2805415987968445, 0.3645338714122772, -0.12762176990509033, -0.22032524645328522, 0.07037070393562317, 0.44712701439857483, -0.022936474531888962, 0.3904954493045807, 0.06357914209365845, 0.20377972722053528, -0.1781635582447052, -0.05238873511...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#examples
Examples <?php use \Pimcore\Model\DataObject; // get a list of cities in Austria by localized field using default locale $list = DataObject\City::getByLocalizedfields("country", "Österreich"); // or $list = DataObject\City::getByCountry("Österreich"); // get a city by localized name using default locale $city = DataObject\City::getByLocalizedfields("city", "Wels", null, 1); // or $city = DataObject\City::getByLocalizedfields("city", "Wels", null, ['limit' => 1]); // or $city = DataObject\City::getByCity("Wels", null, 1); // get the first 10 cities in Austria by localized field using default locale $list = DataObject\City::getByLocalizedfields("country", "Österreich", null, 10); // or $list = DataObject\City::getByCountry("Österreich", null, 10); // get the first 10 cities in Austria by localized field "de" locale $list = DataObject\City::getByLocalizedfields("country", "Österreich", "de", 10); // or $list = DataObject\City::getByCountry("Österreich", "de", 10); //get a country by localized name in english $country = DataObject\Country::getByLocalizedfields("name", "Austria", "en", 1); // or $country = DataObject\Country::getByName("Austria", "en", 1);
Examples
[ -0.4363909065723419, -0.13495953381061554, -0.3767135441303253, 0.24045886099338531, -0.06306090205907822, -0.26778843998908997, 0.23258154094219208, 0.19998012483119965, -0.001763031235896051, 0.3437151312828064, 0.14424043893814087, 0.21704578399658203, 0.16287346184253693, -0.0169084910...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#get-an-object-list-including-unpublished-objects
Get an Object List including unpublished Objects Normally object lists only give published objects. This can be changed by setting a lists unpublished property to true. <?php $list = \Pimcore\Model\DataObject\News::getList(["unpublished" => true]); //or $list = new \Pimcore\Model\DataObject\News\Listing(); $list->setUnpublished(true); $list->load(); Sometimes, by default all unpublished objects are returned even if setUnpublished is set to false. It is the case when working on the admin side (plug-in for instance). You can switch globally the behaviour (it will bypass setUnpublished setting), using the following static method: <?php // revert to the default API behaviour, and setUnpublished can be used as usually \Pimcore\Model\DataObject::setHideUnpublished(true); // force to return all objects including unpublished ones, even if setUnpublished is set to false \Pimcore\Model\DataObject::setHideUnpublished(false);
Get an Object List including unpublished Objects
[ -0.020344415679574013, 0.07558143138885498, -0.17660322785377502, 0.24799665808677673, -0.0987425222992897, -0.42517900466918945, 0.04780964180827141, 0.3870604336261749, -0.15634498000144958, 0.4171251356601715, -0.21591080725193024, 0.3028244972229004, -0.03030012734234333, -0.0681310221...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#filter-objects-by-attributes-from-field-collections
Filter Objects by attributes from Field Collections To filter objects by attributes from field collections, you can use following syntax (Both code snippets result in the same object listing). $list = new DataObject\Collectiontest\Listing(); $list->addFieldCollection("MyCollection", "collection"); $list->addFieldCollection("MyCollection"); $list->setCondition("`MyCollection~collection`.myinput = 'hugo' AND `MyCollection`.myinput = 'testinput'"); <?php $list = \Pimcore\Model\DataObject\Collectiontest::getList([ "fieldCollections" => [ ["type" => "MyCollection", "fieldname" => "collection"], ["type" => "MyCollection"] ], "condition" => "`MyCollection~collection`.myinput = 'hugo' AND `MyCollection`.myinput = 'testinput'" ]); You can add field collections to a listing object by specifying the type of the field collection and optionally the fieldname. The fieldname is the fieldname of the field collection in the class definition of the current object. Once field collections are added to an object listing, you can access attributes of field collections in the condition of the object listing. The syntax is as shown in the examples above FIELDCOLLECTIONTYPE~FIELDNAME.ATTRIBUTE_OF_FIELDCOLLECTION, or if you have not specified a fieldname FIELDCOLLECTION.ATTRIBUTE_OF_FIELDCOLLECTION. The object listing of this example only delivers objects of the type Collectiontest, which have a Fieldcollection of the type MyCollection and the value testinput in the attribute myinput and a Fieldcollection in the field collection of the type MyCollection and the value hugo in the attribute myinput.  
Filter Objects by attributes from Field Collections
[ -0.30005162954330444, 0.1856231391429901, -0.1538505256175995, 0.22194208204746246, 0.03217122703790665, -0.13877269625663757, -0.1959541141986847, 0.43542811274528503, 0.07425367832183838, 0.13733071088790894, -0.35631272196769714, 0.6402925252914429, -0.003889416577294469, -0.17734250426...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#working-with-knp\component\pager\paginator
Working with Knp\Component\Pager\Paginator
Working with Knp\Component\Pager\Paginator
[ 0.2461325228214264, -0.2073609083890915, -0.24693980813026428, -0.12048038840293884, -0.22672785818576813, -0.08326605707406998, -0.02712497115135193, 0.009439106099307537, -0.40545350313186646, 0.19567140936851501, 0.0017807321855798364, 0.39088869094848633, 0.14314550161361694, 0.0170397...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#action
Action public function testAction(Request $request, \Knp\Component\Pager\PaginatorInterface $paginator): Response { $list = new DataObject\Simple\Listing(); $list->setOrderKey("name"); $list->setOrder("asc"); $paginator = $paginator->paginate( $list, $request->get('page', 1), 10 ); return $this->render('Test/Test.html.twig', [ 'paginator' => $paginator, 'paginationVariables' => $paginator->getPaginationData() ]); }
Action
[ 0.058705661445856094, -0.27235090732574463, -0.20602105557918549, 0.006332786753773689, 0.05736585333943367, 0.1376773864030838, -0.16353172063827515, 0.3732144832611084, -0.32230427861213684, 0.17648538947105408, -0.16103293001651764, 0.26129868626594543, 0.0503641702234745, -0.1342508494...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#view
View {% for item in paginator %} <h2>{{ item.name }}</h2> {% endfor %} <br /> {% include 'includes/pagination.html.twig' %}
View
[ 0.18555578589439392, -0.2059844583272934, -0.24744780361652374, -0.042948197573423386, -0.03598778694868088, 0.27552124857902527, -0.05768521875143051, 0.3092368543148041, -0.03590159863233566, -0.028042014688253403, -0.13013529777526855, 0.33678364753723145, -0.13244545459747314, 0.009620...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#partial-script-(includespagination.html.twig)
Partial Script (includes/pagination.html.twig) <nav aria-label="Pagination"> <ul class="pagination justify-content-center"> {% if(paginationVariables.previous is defined) %} <li class="page-item"> <a class="page-link prev" href="{{ pimcore_url({'page': paginationVariables.previous}) }}" aria-label="Previous"> <span aria-hidden="true"></span> </a> </li> {% endif %} {% for page in paginationVariables.pagesInRange %} {% if(paginationVariables.current == page) %} <li class="page-item active" aria-current="page"> <span class="page-link"> {{ page }} <span class="sr-only">(current)</span> </span> </li> {% else %} <li class="page-item"><a class="page-link" href="{{ pimcore_url({'page': page}) }}">{{ page }}</a></li> {% endif %} {% endfor %} {% if(paginationVariables.next is defined) %} <li class="page-item"> <a class="page-link next" href="{{ pimcore_url({'page': paginationVariables.next}) }}" aria-label="Next"> <span class="flip" aria-hidden="true"></span> </a> </li> {% endif %} </ul> </nav>
Partial Script (includes/pagination.html.twig)
[ -0.11675965040922165, -0.33599185943603516, -0.29249316453933716, -0.0334438681602478, 0.16219176352024078, -0.1352159082889557, 0.08899328112602234, 0.19460715353488922, -0.2376818209886551, 0.11479192227125168, -0.0466480515897274, 0.10696683824062347, 0.24757932126522064, 0.179855480790...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#access-and-modify-internal-object-list-query
Access and modify internal object list query It is possible to access and modify the internal query from every object listing. The internal query is based on \Doctrine\DBAL\Query\QueryBuilder. <?php // get all news with ratings that is stored in a not Pimcore related table /** @var \Pimcore\Model\DataObject\Listing\Dao|\Pimcore\Model\DataObject\News\Listing $list */ $list = new Pimcore\Model\DataObject\News\Listing(); // set callback $list->onCreateQueryBuilder( function (\Doctrine\DBAL\Query\QueryBuilder $queryBuilder) use ($list) { $queryBuilder->join('orderItem', 'objects', 'orderItemObjects', 'orderItemObjects.id = orderItem.product__id'); } );
Access and modify internal object list query
[ -0.1291588544845581, 0.11260488629341125, -0.2320757359266281, 0.4765775799751282, -0.012347670271992683, -0.10896323621273041, -0.428928941488266, 0.14549271762371063, -0.44913244247436523, 0.12983529269695282, -0.8024967312812805, 0.1791243553161621, 0.3431932032108307, 0.004576494451612...
https://pimcore.com/docs/platform//Pimcore/Objects/Working_with_PHP_API#debugging-the-object-list-query
Debugging the Object List Query You can access and print the internal query which is based on \Doctrine\DBAL\Query\QueryBuilder to debug your conditions like this: <?php // get all news with ratings that is stored in a not Pimcore related table /** @var \Pimcore\Model\DataObject\Listing\Dao|\Pimcore\Model\DataObject\News\Listing $list */ $list = new Pimcore\Model\DataObject\News\Listing(); // set onCreateQueryBuilder callback $list->onCreateQueryBuilder(function (\Doctrine\DBAL\Query\QueryBuilder $queryBuilder) { // echo query echo $queryBuilder->getSQL(); });
Debugging the Object List Query
[ -0.06491412967443466, 0.016502225771546364, -0.17191854119300842, 0.6033586859703064, 0.07201310992240906, -0.2805594503879547, -0.3827105462551117, 0.29361632466316223, -0.3684167265892029, 0.20729191601276398, -0.3252316117286682, 0.17376668751239777, 0.22499509155750275, -0.154943957924...
https://pimcore.com/docs/platform//Pimcore/Objects/External_System_Interaction#external-system-interaction
External System Interaction Whenever interaction with other systems is required, data objects are the vital components of data exchange. Pimcore data objects can be created, filled and listed programmatically in order to realize batch imports and exports with only very few lines of code. Therefore the recommended way of interacting with external systems is using the PHP API of Pimcore and create a interaction layer with your custom PHP code. This interaction layer can be within a Pimcore plugin, a library component, a custom web service, a CLI Command or just a simple CLI script - you have the full flexibility. To keep things simple, we're using simple CLI scripts in the following example, although we're recommending the use of CLI Commands.
External System Interaction
[ -0.2735406160354614, -0.20027726888656616, -0.12294679880142212, 0.2547956109046936, -0.1475546807050705, -0.4007675349712372, 0.13107933104038239, -0.19099316000938416, -0.040977537631988525, 0.24188989400863647, -0.2323770672082901, 0.2179669439792633, 0.32786110043525696, 0.381737530231...
https://pimcore.com/docs/platform//Pimcore/Objects/External_System_Interaction#import
Import The following example indicates the creation of a new object of the class myclass. Put the following script into the file /bin/example.php (or any other PHP file). <?php namespace App\Command; use Pimcore\Console\AbstractCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Pimcore\Model\DataObject; class AwesomeCommand extends AbstractCommand { protected function configure(): void { $this ->setName('app:awesome') ->setDescription('Awesome command'); } protected function execute(InputInterface $input, OutputInterface $output): int { //create single object $object = new DataObject\Myclass(); $object->setKey(1); $object->setParentId(1); $object->setPublished(true); $object->setMyattribute("This is a test"); $object->save(); // or create multiple objects for ($i = 0; $i < 60; $i++) { $o = new DataObject\News(); $o->setKey(uniqid() . "-" . $i); $o->setParentId(1); $o->setPublished(true); $o->save(); $output->writeln("Created object " . $o->getFullPath() . "\n"); } } } Thus, with very few lines of codes importer scripts can be implemented to populate data objects. Please have a look at Pimcore\Console how to integrate your custom CLI scripts to the Pimcore console.
Import
[ -0.22707326710224152, -0.03786034509539604, -0.008305782452225685, 0.03236792981624603, 0.10404566675424576, -0.3309025466442108, 0.178402379155159, 0.09832390397787094, -0.22602592408657074, 0.30716845393180847, -0.12615057826042175, 0.27595603466033936, 0.03494841605424881, 0.21202374994...
https://pimcore.com/docs/platform//Pimcore/Objects/External_System_Interaction#export
Export Export of data objects can be achieved programmatically similar to imports by using object listings and writing just a few lines of code. $file = fopen("export.csv","w"); $entries = new DataObject\Myclassname\Listing(); $entries->setCondition("name LIKE ?", "%bernie%"); foreach($entries as $entry) { fputcsv($file, [ 'id' => $entry->getId(), 'name' => $entry->getName() ]); } fclose($file); For simple CSV exports, Pimcore backend interface provides a CSV export functionality.
Export
[ -0.32349908351898193, 0.08628945052623749, -0.20103195309638977, 0.15605959296226501, 0.16706283390522003, -0.1432069092988968, 0.26998642086982727, 0.38035938143730164, -0.07564891129732132, 0.41037529706954956, -0.20171132683753967, 0.18710607290267944, 0.037005405873060226, 0.4570283293...
https://pimcore.com/docs/platform//Pimcore/Objects/External_System_Interaction#memory-issues
Memory Issues If you're using / creating very much objects you should call the Pimcore garbage collector after several cycles to prevent memory issues // just call this static method \Pimcore::collectGarbage(); WARNING: This will flush the entire internal registry! To avoid this, you can pass an array with keys (indexes) which should stay in the registry eg. \Pimcore::collectGarbage(["myImportantKey", "myConfig"]); // You can also add items to the static list of globally protected keys by passing them to $longRunningHelper = \Pimcore::getContainer()->get(\Pimcore\Helper\LongRunningHelper::class); $longRunningHelper->addPimcoreRuntimeCacheProtectedItems(["myVeryImportantKey", "mySuperImportKey", "..."]); // This list is maintained as long as the process exists. You can remove protected keys again by calling $longRunningHelper->removePimcoreRuntimeCacheProtectedItems(["myVeryImportantKey", "mySuperImportKey", "..."]); You can pass in a string instead of an array if you only want to supply a single key.
Memory Issues
[ -0.4403816759586334, -0.19848865270614624, -0.12723016738891602, 0.3295550048351288, 0.15897813439369202, -0.29768073558807373, 0.08469278365373611, 0.13049151003360748, -0.18085893988609314, 0.2741531431674957, 0.052807461470365524, 0.31824547052383423, -0.0023184323217719793, -0.00772831...
https://pimcore.com/docs/platform//Pimcore/Objects/External_System_Interaction#temporary-files
Temporary files Temporary files which get created during processing are usually deleted when the current process finishes. In some cases this may be a problem when thousands of temporary files get created within a process. If you want to clear temporary files before the script ends, you can call \Pimcore::deleteTemporaryFiles();
Temporary files
[ -0.20736533403396606, -0.42886048555374146, -0.14761926233768463, 0.07060958445072174, 0.05254584178328514, -0.1967405378818512, 0.03854683041572571, 0.13630908727645874, -0.07516589015722275, 0.4305940568447113, 0.019236180931329727, 0.30087193846702576, 0.18001754581928253, -0.0559106655...
https://pimcore.com/docs/platform//Pimcore/Objects/Customize_Editing_Interface#customize-editing-interface
Customize Editing Interface
Customize Editing Interface
[ 0.13639433681964874, -0.3544979989528656, -0.26798033714294434, -0.17864841222763062, -0.030726928263902664, -0.06423410773277283, 0.3048098385334015, 0.19018346071243286, -0.16970930993556976, 0.18347050249576569, -0.23624187707901, 0.42527684569358826, 0.09977030009031296, 0.390708386898...
https://pimcore.com/docs/platform//Pimcore/Objects/Customize_Editing_Interface#customize-add-object-dialog
Customize Add Object Dialog To customize the Add Object dialog, just create admin translations in the following format: object_add_dialog_custom_title.CLASSNAME object_add_dialog_custom_text.CLASSNAME replace CLASSNAME with the actual name of the class of which dialog you'd like to customize (case-sensitive).
Customize Add Object Dialog
[ 0.2579376995563507, 0.15588639676570892, -0.053377557545900345, 0.011824391782283783, 0.05103108286857605, 0.02404128387570381, 0.2755325734615326, -0.03351766616106033, -0.0501892976462841, 0.3250480890274048, -0.19156189262866974, 0.14003343880176544, 0.043620817363262177, 0.136843279004...
https://pimcore.com/docs/platform//Pimcore/Objects/Customize_Editing_Interface#example
Example
Example
[ -0.039029549807310104, -0.4887920916080475, -0.3070780634880066, 0.04008098319172859, -0.14495046436786652, -0.15570281445980072, 0.2727290093898773, 0.16836415231227875, -0.006077707279473543, 0.44112470746040344, 0.5344760417938232, 0.21058650314807892, -0.14281579852104187, 0.0040315156...
https://pimcore.com/docs/platform//Pimcore/Objects#objects
Objects Objects are the PIM part of Pimcore and are the way to go for managing structured data within Pimcore. Based on a class definition that defines structure and attributes object can be used for pretty much any structured data – may it be products, categories, persons, customers, news, orders, blog entries, … For the attributes many datatypes (simple ones and really complex ones) are available. Pimcore objects are literally objects in the sense of object oriented programming. The class definition can be defined through a user friendly graphical user interface (GUI), but nevertheless in the background a plain PHP class is created, which can profit from inheritance and can be utilized and accessed within your custom PHP code. So managing data becomes really easy. Data objects can be instantiated and filled within Pimcore backend or within your custom code by using the PHP API and common programming paradigms (create new instances, using getter and setter, ...). For saving objects just call the `save`` method and Pimcore takes care of the rest. So it is also really easy to serve object from external systems like CRM, ERP, PIM or asset management systems. This chapter describes following aspects of objects from a technical point of view: Object Classes Working with Objects via PHP API External System Interaction For all the provided backend functionality within Pimcore have a look at the User Documentation of Pimcore. [comment]: #(TODO add link)
Objects
[ 0.1086544618010521, -0.1489904224872589, -0.16705788671970367, 0.3179793059825897, -0.05126336216926575, -0.2121262103319168, -0.095582515001297, -0.07966749370098114, -0.36150407791137695, 0.15262120962142944, -0.15567703545093536, 0.14908336102962494, -0.06128348782658577, 0.369771480560...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Localize_your_Documents#localize-your-documents
Localize Your Documents Pimcore allows you to localize every document. You can find the setting in your document in the tab Properties. There you can choose from language which is configured in the system settings. The selected language is registered as a property on the document, which is inherited to all of its children. If you have selected a language this will be automatically set on your request object ($request->getLocale()) and is therefore automatically used for shared translations, localized object lists and all other localized kind of contents. Since the language is a simple property you can access it like every other property like: // in your controller / action $locale = $request->getLocale(); //or $language = $this->document->getProperty("language"); // any document $doc = \Pimcore\Model\Document::getById(234); $language = $doc->getProperty("language"); {% set documentLanguage = document.getProperty('language') %} Once you have defined the language of your documents you can also use the translate helper in your views, as described here. Pimcore uses the standard Symfony translator, so you can even access all the translations provided by your bundles.
Localize Your Documents
[ -0.16022495925426483, 0.10377693921327591, -0.20912757515907288, 0.12414078414440155, 0.049432892352342606, -0.17451231181621552, 0.06516458094120026, 0.22612322866916656, -0.2387213259935379, 0.245790496468544, -0.38428759574890137, 0.24102742969989777, 0.09382409602403641, -0.01699294894...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Localize_your_Documents#translating-terms-on-the-website
Translating terms on the website Pimcore comes with a translation module for the website which is explained in Shared Translations. This is what needs to be done to use translations in templates and display them accordingly on the website (frontend). E.g. button names, labels - all the stuff that is predefined by the template and not entered by the editor.
Translating terms on the website
[ 0.1627354472875595, -0.21581582725048065, -0.1743152141571045, 0.11553128808736801, 0.19859489798545837, -0.22425299882888794, 0.18805411458015442, -0.08878017216920853, -0.16920650005340576, 0.3487964868545532, -0.34274235367774963, 0.22589616477489471, 0.38646072149276733, 0.273864060640...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Localize_your_Documents#more-about-this
More about this To learn more about this visit the best practices for multilanguage pages
More about this
[ 0.0858728215098381, -0.2501734495162964, -0.352053165435791, 0.02277945913374424, 0.021902412176132202, -0.14660608768463135, 0.31125783920288086, -0.10626515746116638, -0.00805879756808281, 0.3540187180042267, -0.12075024843215942, -0.16706855595111847, 0.33303776383399963, 0.110362417995...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#shared-translations
Shared Translations Pimcore provides an easy way for editors to edit commonly used translation terms across the application, which can be found here: Extras > Translation > Shared Translations. In the background the standard Symfony Translator component is used to add the shared translation functionality to the application. The main benefit is that you have only one single translator for all your translations. It automatically uses the locale specified on a document or from a fallback mechanism. For more information, please also check out Symfony's Translations Component. Available languages are defined within the system languages, see here. Shared translations are stored in translations_messages database table and can be versioned using Migrations.
Shared Translations
[ 0.06251446157693863, -0.04416893050074577, -0.1682005077600479, -0.03575563058257103, -0.09624645113945007, -0.1864064633846283, 0.22569343447685242, -0.17445087432861328, -0.21397261321544647, 0.39956045150756836, -0.3600722849369049, 0.12184081971645355, 0.40169191360473633, -0.259036362...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#translations-case-sensitivity
Translations case sensitivity Translations are case sensitive by default. You can reconfigure Pimcore to handle website and admin translations as case insensitive, however as this implies a performance hit (translations might be looked up twice) and it does not conform with Symfony's translators you're encouraged to reference translation keys with the same casing as they were saved.
Translations case sensitivity
[ -0.06846612691879272, -0.11046754568815231, -0.08605492860078812, 0.031854722648859024, 0.1559578776359558, -0.36980441212654114, 0.2779012620449066, -0.07026314735412598, -0.32144707441329956, 0.44345158338546753, -0.2698526084423065, 0.06681157648563385, 0.4072093367576599, -0.3943430185...