url
stringlengths
50
196
text
stringlengths
3
17.2k
heading
stringlengths
2
103
embeddings
list
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#working-with-shared-translations--the-translator-in-code
Working with Shared Translations / the Translator in Code
Working with Shared Translations / the Translator in Code
[ 0.04146295413374901, -0.10625360906124115, -0.3001459538936615, 0.16559843719005585, -0.05802017077803612, -0.4245757758617401, 0.501295804977417, -0.08671589940786362, -0.24828751385211945, 0.44694259762763977, -0.00250150915235281, 0.08876267820596695, 0.1558723896741867, -0.137444019317...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#example-in-templates--views
Example in Templates / Views You can also use variable interpolation in localized messages. <div> <address>© {{ 'Copyright'|trans }}</address> <a href="/imprint">{{ 'Imprint'|trans }}</a> {# variable interpolation, 'about' translates to 'About {{siteName}}' #} <a href="/about">{{ 'about'|trans({'{{siteName}}': siteName}) }}</a> </div> Parameters in translations can be wrapped in double curly braces ({{ and }}) but you are free to use other placeholder wrappers as well, e.g. %parameter% like in the Symfony docs also works.
Example in Templates / Views
[ 0.22269167006015778, -0.2131785899400711, -0.09929642081260681, -0.26474303007125854, 0.1751018613576889, -0.4386803209781647, 0.3204113841056824, 0.10010578483343124, -0.07101476192474365, 0.36134594678878784, 0.16652272641658783, -0.026653047651052475, 0.1288967728614807, -0.113275811076...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#example-in-a-controller
Example in a Controller <?php namespace App\Controller; use Pimcore\Controller\FrontendController; use Symfony\Component\HttpFoundation\Response; use Symfony\Contracts\Translation\TranslatorInterface; class ContentController extends FrontendController { public function defaultAction(TranslatorInterface $translator): Response { $translatedLegalNotice = $translator->trans("legal_notice"); $siteName = "Demo"; // or get dynamically // variable interpolation, 'about' translates to 'About {{siteName}}' $translatedAbout = $translator->trans("about", ['siteName' => $siteName]); // ... } }
Example in a Controller
[ -0.11944153159856796, -0.19683854281902313, -0.1653689742088318, 0.06468164920806885, 0.15006117522716522, -0.367803692817688, 0.23172275722026825, 0.1957806497812271, -0.12676464021205902, 0.5533053874969482, 0.04996069520711899, 0.0943349078297615, 0.3697419762611389, -0.0531958751380443...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#translation-pluralizationselection
Translation Pluralization/Selection Since Pimcore uses Symfony Translator component in background, you can store and use the translations in ICU Message Format(supported by Symfony Translator) for Pluralization, Selection and more. Read here This can be achieved in Pimcore by selecting type "ICU Format" on translation UI and passing required parameter in view/Controller. e.g. Add translation key and select type "ICU Format". Click on language cell plain text button to edit and add translation in ICU format {variable_name, function_name, function_statement} Use in view {{ 'cars_sold'|trans({'sold_count': 0}) }} {# output: No car sold yet. #} {{ 'cars_sold'|trans({'sold_count': 1}) }} {# output: Only one car sold. #} {{ 'cars_sold'|trans({'sold_count': 100}) }} {# output: Total of 100 cars sold! #}
Translation Pluralization/Selection
[ -0.2523398697376251, -0.07135989516973495, -0.205367311835289, 0.11474397033452988, -0.014314671978354454, -0.413518488407135, 0.28270432353019714, -0.0860014334321022, -0.26838958263397217, 0.27987486124038696, -0.19885432720184326, 0.10958272218704224, 0.2688458561897278, 0.2503081262111...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#pimcore-backend-functionalities
Pimcore backend functionalities
Pimcore backend functionalities
[ -0.17912425100803375, -0.23701603710651398, -0.2902149260044098, -0.04254186898469925, 0.018179237842559814, -0.3058475852012634, 0.16054050624370575, -0.22222378849983215, -0.44093629717826843, 0.24152079224586487, -0.36931300163269043, 0.46577659249305725, 0.2392117828130722, 0.478792369...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#sorting-&-filtering-on-language-level
Sorting & Filtering on language level
Sorting & Filtering on language level
[ 0.07673031091690063, -0.09597402065992355, -0.3927312195301056, 0.2680542767047882, 0.08623326569795609, -0.4516203999519348, 0.09731259942054749, 0.25738874077796936, 0.07263225317001343, 0.08955611288547516, -0.34451165795326233, -0.07286926358938217, -0.14141088724136353, 0.290196180343...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Shared_Translations#translation-export-&-import
Translation Export & Import Translations can be exported to a CSV file and then re-imported later on. Translations are still imported automatically as long as the translation key does not exist in the target system or the translation itself is still empty. Conflicts (i.e. the translation in the target system does not match the version of the source) are shown in an overview tab and then can be merged manually.
Translation Export & Import
[ -0.1570039540529251, -0.11678768694400787, -0.17939884960651398, 0.05098911374807358, 0.0058044567704200745, 0.057785484939813614, 0.06892380118370056, 0.08467027544975281, 0.021024130284786224, 0.210211381316185, -0.2270779013633728, -0.03643551841378212, 0.19789233803749084, 0.1900608390...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Admin_Translations#admin-translations
Admin Translations There are several components in the Pimcore backend UI which are configured differently for each project. These are object class names object field labels object layout components document types predefined properties custom views document editables All these elements (except document editables) can be translated in Settings > Admin Translations similar to the Shared Translations. All installed system languages are available for translation. It's even possible to override the system translations shipped with Pimcore, so basically you can translate anything within the backend UI. Strings which are subject to special translations, but have not been translated yet, are displayed with a "+" in front and after the string, if Debug Admin-Translations (wrapped in +) is activated in system settings (Settings > System Settings). But you can use the admin translation also in your custom templates. Admin translations use the same translator component (Symfony) but on a different domain. Admin translations underlay the same case sensitivity logic as shared translations.
Admin Translations
[ -0.06373138725757599, -0.10634779930114746, -0.15753011405467987, -0.05395789071917534, 0.08041863143444061, -0.21301311254501343, 0.16275551915168762, -0.06328558921813965, -0.36882418394088745, 0.24244891107082367, -0.31950217485427856, 0.14453676342964172, 0.39516976475715637, -0.089288...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Admin_Translations#example:-translate-options-of-a-select-editable-in-the-language-of-the-current-user
Example: Translate Options of a Select Editable in the language of the current user {{ pimcore_select("select", { "store": [ ["option1", {{ "Option One"|trans({}, 'admin', pimcore_editmode_admin_language()) }}], ["option2", {{ "Option Two"|trans({}, 'admin', pimcore_editmode_admin_language()) }}], ["option3", {{ "Option Three"|trans({}, 'admin', pimcore_editmode_admin_language()) }}] ] }) }}
Example: Translate Options of a Select Editable in the language of the current user
[ -0.19982050359249115, -0.2323388308286667, -0.23360536992549896, -0.02087220549583435, 0.25065305829048157, -0.45838242769241333, 0.02266623266041279, -0.013250057585537434, -0.4287841320037842, 0.1635628342628479, -0.10037720948457718, 0.6016128659248352, 0.06583060324192047, 0.3303530514...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Admin_Translations#adding-your-own-admin-languages-(since-v6.3.6)
Adding your own admin languages (since v6.3.6) Pimcore comes with a set of translations which are managed by POEditor. There is a list of essential translations and another extended translations list. However, the amount of available languages is limited, because only languages with certain translation progress are included in the main distribution. If you want to make additional languages available for the admin interface, you can do so by putting a symfony translation file for the desired language into the default path for the symfony translator (e.g. use translations/admin.af.yaml for making Afrikaans available, the translation file can be also empty). If you haven't configured anything different this is %kernel.project_dir%/translations for Symfony 4 projects.
Adding your own admin languages (since v6.3.6)
[ 0.06437519192695618, -0.015870114788413048, -0.20554646849632263, 0.12472055852413177, 0.05893781781196594, -0.14910554885864258, -0.051638077944517136, -0.1354990154504776, -0.0718783512711525, 0.3701680898666382, -0.3601404130458832, 0.13432981073856354, 0.1305243819952011, 0.00293163908...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Admin_Translations#override-language-of-admin-translations-in-editmode-of-documents
Override language of admin translations in editmode of documents In some projects you want to use a different language as admin translations, e.g. English (en) instead of Croatian (hr) or Chinese (zh_Hans) instead of Chinese (zh). # config/config.yaml pimcore: translations: admin_translation_mapping: 'hr': 'en' 'zh': 'zh_Hans'
Override language of admin translations in editmode of documents
[ 0.09050021320581436, -0.14927595853805542, -0.12267201393842697, -0.025819048285484314, 0.2165650725364685, -0.17439334094524384, 0.1414254605770111, 0.06716186553239822, -0.1694914698600769, 0.3541032075881958, -0.13687004148960114, 0.29582202434539795, 0.2707288861274719, 0.0477168485522...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Formatting_Service#formatting-service
Formatting Service Pimcore ships a service for international formatting of numbers, currencies and date time. The service is basically a factory and wrapper of the IntlDateFormatter component of php.
Formatting Service
[ -0.3240501582622528, -0.20499065518379211, -0.1465415507555008, -0.02008521556854248, -0.031987134367227554, -0.29340988397598267, 0.3437008857727051, 0.10502511262893677, -0.5111496448516846, 0.09745161235332489, -0.01054767519235611, -0.011503022164106369, 0.17643298208713531, 0.35867673...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Formatting_Service#usage-example
Usage Example <?php $service = \Pimcore::getContainer()->get(Pimcore\Localization\IntlFormatter::class); //optionally set locale (otherwise it is resolved from the request) $service->setLocale("de"); echo $service->formatDateTime($time, IntlFormatter::DATETIME_MEDIUM); echo $service->formatNumber("45632325.32"); echo $service->formatCurrency("45632325.32", "EUR"); //for formatting currencies you can also define a pattern echo $service->formatCurrency("45632325.32", "EUR", "#,##0.00 ¤¤");
Usage Example
[ -0.5899254083633423, -0.2325669676065445, -0.23130738735198975, 0.2672753632068634, 0.08675095438957214, -0.405439168214798, 0.3842502236366272, 0.15574334561824799, -0.24563488364219666, 0.3916128873825073, 0.08366987109184265, 0.2727968096733093, 0.20580683648586273, 0.10323702543973923,...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n/Formatting_Service#overwriting-definition
Overwriting Definition You can overwrite the default service definition with your own, e.g. to overwrite the default currency patterns. services: # Formatting service for dates, times and numbers Pimcore\Localization\IntlFormatter: calls: - [setCurrencyFormat, ['en', '¤ #,##0.0']] - [setCurrencyFormat, ['de', '#,##0.00 ¤¤']]
Overwriting Definition
[ -0.37475088238716125, -0.1093299612402916, -0.1163058802485466, -0.142222061753273, 0.2221192568540573, -0.3747858703136444, 0.27043455839157104, -0.048105064779520035, -0.1833917796611786, 0.3297675848007202, -0.15088404715061188, 0.5494776964187622, 0.2255529761314392, 0.3239999413490295...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n#multi-language-i18n-&-localization-in-pimcore
Multi Language i18n & Localization in Pimcore Localization is a very important aspect in every content management. In Pimcore localization can be centrally configured and has influence on multiple aspects within the system. Bottom line is that using Pimcore in a multi language mode is pretty easy for users and developers. Pimcore takes care of all technical aspects and by doing so follows the ZF patterns. Pimcore has different sets of languages/locales and translations for the back end (CMS) and front end (website). This allows you to have the user interface of Pimcore in different languages than the website. You need to be aware of this when requesting the current and available locales, as they are different depending on the context. If a user is saving an object in Pimcore which is set to English, the current locale is different then when a visitor on your French website triggers a save action.
Multi Language i18n & Localization in Pimcore
[ -0.018648607656359673, -0.197342187166214, -0.21274025738239288, 0.07897203415632248, -0.17897583544254303, -0.2664327323436737, 0.17768467962741852, -0.10803946852684021, -0.32484665513038635, 0.2726795971393585, -0.5537423491477966, -0.04832857847213745, 0.2786494791507721, 0.13122160732...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n#content-localization
Content Localization
Content Localization
[ -0.05402661859989166, -0.21872802078723907, -0.3605634570121765, -0.02826707810163498, 0.23794709146022797, -0.0834374949336052, 0.17575515806674957, 0.16722974181175232, -0.15233471989631653, 0.18584346771240234, -0.1104912981390953, 0.09396078437566757, 0.007721529807895422, 0.1297099292...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n#language-configuration
Language Configuration The available languages for content are configured centrally in system settings (Settings > System Settings > Localization & Internationalization (i18n/l10n)). Following settings can be defined here: Available languages System wide default language Fallback language for each language: if defined, Pimcore returns values from fallback language if primary language has no values set. Note: Removing language from the Localization & Internationalization (i18n/l10n) list will not delete its respective data. Please use console command pimcore:locale:delete-unused-tables for cleanup.
Language Configuration
[ -0.07957926392555237, -0.24068781733512878, -0.17443715035915375, 0.23916871845722198, -0.006722298916429281, -0.15510180592536926, -0.053246960043907166, 0.0975177139043808, -0.220114067196846, 0.37380510568618774, -0.4523860812187195, 0.3688275218009949, 0.25477927923202515, 0.0753706544...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n#localized-content-areas
Localized Content Areas The activated languages have influence to following modules of content within Pimcore: Document - Localization (system property for language) Shared Translations (Symfony Translations Component) Localized Fields for Objects (object localization) Structured Data Fields - Classification Store
Localized Content Areas
[ -0.0718080997467041, -0.2335403859615326, -0.1929086595773697, 0.1372678279876709, 0.13308022916316986, -0.3863667845726013, 0.4458957314491272, -0.16141046583652496, -0.1078515499830246, 0.07503928989171982, -0.3531908094882965, 0.3419593274593353, 0.25916019082069397, 0.11982665210962296...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n#pimcore-backend-ui-localization
Pimcore Backend UI Localization Pimcore backend UI localization is independent from content localization but works similar to Shared Translations. Basically every text in Pimcore backend is translatable, but there are two different sources for translations - Pimcore system translations and project specific translations.
Pimcore Backend UI Localization
[ 0.07819385081529617, -0.0070754168555140495, -0.17825283110141754, -0.13123446702957153, 0.13327571749687195, -0.29684266448020935, 0.2642788887023926, -0.1918725222349167, -0.359781414270401, 0.1601526141166687, -0.4737061560153961, 0.3114919066429138, 0.4718402028083801, 0.21216754615306...
https://pimcore.com/docs/platform//Pimcore/Multi_Language_i18n#pimcore-system-translations
Pimcore System Translations This covers all labels and texts within Pimcore that ship with Pimcore installation package. Here the standard language English is maintained by the core team. In addition to that, everybody can join the Pimcore translation project to add system translations in additional languages. With every Pimcore release, newly added translations are added to the Pimcore installation package. System translations can be overwritten by Admin Translations.
Pimcore System Translations
[ 0.019032396376132965, -0.024959087371826172, -0.1628904640674591, 0.08194877207279205, 0.07431569695472717, -0.0461001954972744, 0.14706623554229736, -0.37468501925468445, -0.19494426250457764, 0.13619758188724518, -0.3784792423248291, 0.2750329077243805, 0.3163915276527405, 0.092636376619...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Configuration_Details/Placeholder_Example#placeholder-example
Placeholder Example Workflows support placeholders. By using placeholders, it is possible, to reuse an existing workflow and reapply places and transitions onto a new workflow.
Placeholder Example
[ 0.1371012181043625, -0.2866462469100952, -0.1896933913230896, -0.4336639642715454, -0.03930502012372017, -0.3014222979545593, 0.29701605439186096, 0.16448643803596497, 0.13362930715084076, 0.15813642740249634, 0.45697271823883057, 0.171588733792305, 0.045153338462114334, 0.0027696066536009...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Configuration_Details/Placeholder_Example#available-options
Available options Example: pimcore: workflows: product_workflow_local_de: &local_workflow_reference placeholders: '%%stateFieldName%%': 'translationStateDe' '%%locale%%': 'de' enabled: true label: "Local Release Workflow" type: "state_machine" supports: &local_workflow_supports_ref - \Pimcore\Model\DataObject\Product initial_markings: "local_300_basic_data_pending" marking_store: &local_workflow_marking_store_ref type: single_state arguments: - %%stateFieldName%% places: &local_workflow_places_ref 100_new: label: "Basic Data Pending from Global Workflow (%%locale%%)" visibleInHeader: true color: '#cddc39' colorInverted: false permissions: - publish: true local_300_basic_data_pending: label: "Pending" visibleInHeader: true color: '#cddc39' colorInverted: false permissions: - publish: true ... transitions: &local_workflow_transitions_ref to_published: to: local_400_published from: [local_700_locked] guard: is_fully_authenticated() and ('ROLE_PIMCORE_ADMIN' in role_names or 'ROLE_RECIPE_WORKFLOW_FINISH_DEVELOPMENT' in role_names) options: label: 'Set to local_400_published' .... Example cloned workflows: product_workflow_local_en: placeholders: '%%stateFieldName%%': 'translationStateEn' '%%locale%%': 'en' '%%flag%%': 'gb' enabled: true label: "Local Release Workflow" type: "state_machine" supports: <<: *local_workflow_supports_ref initial_markings: "local_300_basic_data_pending" marking_store: <<: *local_workflow_marking_store_ref places: <<: *local_workflow_places_ref transitions: <<: *local_workflow_transitions_ref product_workflow_local_hr: placeholders: '%%stateFieldName%%': "translationStateHr" '%%locale%%': "hr" '%%flag%%': 'hr' enabled: true label: "Local Release Workflow" type: "state_machine" supports: <<: *local_workflow_supports_ref initial_markings: "local_300_basic_data_pending" marking_store: <<: *local_workflow_marking_store_ref places: <<: *local_workflow_places_ref transitions: <<: *local_workflow_transitions_ref product_workflow_local_ro: placeholders: '%%stateFieldName%%': "translationStateRo" '%%locale%%': "ro" '%%flag%%': 'ro' enabled: true label: "Local Release Workflow" type: "state_machine" supports: <<: *local_workflow_supports_ref initial_markings: "local_300_basic_data_pending" marking_store: <<: *local_workflow_marking_store_ref places: <<: *local_workflow_places_ref transitions: <<: *local_workflow_transitions_ref ...
Available options
[ -0.24983970820903778, -0.018214836716651917, -0.052838414907455444, -0.293576717376709, -0.07433095574378967, -0.3913562595844269, 0.6957368850708008, 0.40620094537734985, -0.22761259973049164, 0.2441016137599945, -0.1896914392709732, 0.6185370087623596, 0.08955860882997513, 0.106052972376...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Configuration_Details#details
Details
Details
[ -0.09611190110445023, -0.3147600591182709, -0.4425240755081177, 0.45816361904144287, -0.15648099780082703, -0.259223610162735, 0.03211935982108116, -0.1329442858695984, -0.7123774290084839, 0.325860857963562, -0.10344424843788147, 0.11065515130758286, -0.007851880043745041, 0.2057459503412...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Configuration_Details#available-options
Available options pimcore: workflows: # Prototype name: # Placeholder values in this workflow configuration (locale: "%%locale%%") will be replaced by the given placeholder value (eg. "de_AT") placeholders: # Example: placeholders: %%locale%%: de_AT # Can be used to enable or disable the workflow. enabled: true # When multiple custom view or permission settings from different places in different workflows are valid, the workflow with the highest priority will be used. priority: 0 # Will be used in the backend interface as nice name for the workflow. If not set the technical workflow name will be used as label too. label: ~ # Enable default audit trail feature provided by Symfony. Take a look at the Symfony docs for more details. audit_trail: enabled: false # A workflow with type "workflow" can handle multiple places at one time whereas a state_machine provides a finite state_machine (only one place at one time). Take a look at the Symfony docs for more details. type: ~ # One of "workflow"; "state_machine" # Handles the way how the state/place is stored. If not defined "state_table" will be used as default. Take a look at the marking store section of the Pimcore workflow docs for a description of the different types. marking_store: type: ~ # One of "multiple_state"; "single_state"; "state_table"; "data_object_multiple_state"; "data_object_splitted_state" arguments: [] service: ~ # List of supported entity classes. Take a look at the Symfony docs for more details. supports: # Example: - \Pimcore\Model\DataObject\Product # Can be used to implement a special logic which subjects are supported by the workflow. For example only products matching certain criteria. Take a look at the support strategies page of the Pimcore workflow docs for more details. support_strategy: # Examples: type: expression arguments: - \Pimcore\Model\DataObject\Product - subject.getProductType() == "article" and is_fully_authenticated() and "ROLE_PIMCORE_ADMIN" in role_names # Type "expression": a symfony expression to define a criteria. type: ~ # One of "expression" arguments: [] # Define a custom service to handle the logic. Take a look at the Symfony docs for more details. service: ~ # Possibility to add multiple initial places. initial_markings: [] places: # Example: places: closed: label: close product permissions: - condition: is_fully_authenticated() and 'ROLE_PIMCORE_ADMIN' in role_names modify: - modify: objectLayout: 2 # Prototype - # Nice name which will be used in the Pimcore backend. label: ~ # Title/tooltip for this place when it is displayed in the header of the Pimcore element detail view in the backend. title: '' # Color of the place which will be used in the Pimcore backend. color: '#bfdadc' # If set to true the color will be used as border and font color otherwise as background color. colorInverted: false # If set to false, the place will be hidden in the header of the Pimcore element detail view in the backend. visibleInHeader: true permissions: # Prototype - # A symfony expression can be configured here. The first set of permissions which are matching the condition will be used. condition: ~ # save permission as it can be configured in Pimcore workplaces save: ~ # publish permission as it can be configured in Pimcore workplaces publish: ~ # unpublish permission as it can be configured in Pimcore workplaces unpublish: ~ # delete permission as it can be configured in Pimcore workplaces delete: ~ # rename permission as it can be configured in Pimcore workplaces rename: ~ # view permission as it can be configured in Pimcore workplaces view: ~ # settings permission as it can be configured in Pimcore workplaces settings: ~ # versions permission as it can be configured in Pimcore workplaces versions: ~ # properties permission as it can be configured in Pimcore workplaces properties: ~ # a short hand for save, publish, unpublish, delete + rename modify: ~ # if set, the user will see the configured custom data object layout objectLayout: ~ transitions: # Required # Example: close_product: from: open to: closed options: label: close product notes: commentEnabled: 1 commentRequired: 1 additionalFields: - name: accept title: accept terms required: 1 fieldType: checkbox - name: select title: please select a type setterFn: setSpecialWorkflowType fieldType: select fieldTypeSettings: options: - key: Option A value: a - key: Option B value: b - key: Option C value: c # Prototype - name: ~ # Required # An expression to block the transition guard: ~ # Example: is_fully_authenticated() and 'ROLE_JOURNALIST' in role_names and subject.getTitle() == 'My first article' from: [] to: [] options: # Nice name for the Pimcore backend. label: ~ notes: # If enabled a detail window will open when the user executes the transition. In this detail view the user be asked to enter a "comment". This comment then will be used as comment for the notes/events feature. commentEnabled: false # Set this to true if the comment should be a required field. commentRequired: false # Can be used for data objects. The comment will be saved to the data object additionally to the notes/events through this setter function. commentSetterFn: ~ # Can be used for data objects to prefill the comment field with data from the data object. commentGetterFn: ~ # Set's the type string in the saved note. type: 'Status update' # An optional alternative "title" for the note, if blank the actions transition result is used. title: ~ # Add additional field to the transition detail window. additionalFields: # Prototype - # The technical name used in the input form. name: ~ # Required # The data component name/field type. fieldType: ~ # One of "input"; "numeric"; "textarea"; "select"; "datetime"; "date"; "user"; "checkbox", Required # The label used by the field title: ~ # Whether or not the field is required. required: false # Optional setter function (available in the element, for example in the updated object), if not specified, data will be added to notes. The Workflow manager will call the function with the whole field data. setterFn: ~ # Will be passed to the underlying Pimcore data object field type. Can be used to configure the options of a select box for example. fieldTypeSettings: [] # Configure the output of custom HTML for a transition. customHtml: # Define a custom service for rendering custom HTML within the note modal. service: 'App\Service\Workflow\CustomHtmlService' # Set position of custom HTML inside modal (top, center, bottom; default=top). position: 'top' # Css class to define the icon which will be used in the actions button in the backend. iconClass: ~ # Forces an object layout after the transition was performed. # This objectLayout setting overrules all objectLayout settings within the places configs. objectLayout: false notificationSettings: # Prototype - # A symfony expression can be configured here. All sets of notification which are matching the condition will be used. condition: ~ # Send a email notification to a list of users (user names) when the transition get's applied notifyUsers: [] # Send a email notification to a list of user roles (role names) when the transition get's applied notifyRoles: [] # Define which channel notification should be sent to, possible values "mail" and "pimcore_notification", default value is "mail". channelType: # Default: - mail # Type of mail source. mailType: template # One of "template"; "pimcore_document" # Path to mail source - either Symfony path to template or fullpath to Pimcore document. Optional use %_locale% as placeholder for language. mailPath: '@PimcoreCore/Workflow/NotificationEmail/notificationEmail.html.twig' # Change published state of element while transition (only available for documents and data objects). changePublishedState: no_change # One of "no_change", "force_unpublished", "force_published", "save_version" # behaviour when transition gets applied but there are unsaved changes unsavedChangesBehaviour: warn # One of "warn", "save", "ignore" # Actions which will be added to actions button independently of the current workflow place. globalActions: # Prototype - # Nice name for the Pimcore backend. label: ~ # Css class to define the icon which will be used in the actions button in the backend. iconClass: ~ # Forces an object layout after the global action was performed. # This objectLayout setting overrules all objectLayout settings within the places configs. objectLayout: false # An expression to block the action guard: ~ # Example: is_fully_authenticated() and is_granted('ROLE_JOURNALIST') and subject.getTitle() == 'My first article' # Optionally set the current place of the workflow. Can be used for example to reset the workflow to the initial place. to: [] # See notes section of transitions. It works exactly the same way. notes: commentEnabled: false commentRequired: false commentSetterFn: ~ commentGetterFn: ~ type: 'Status update' title: ~ additionalFields: # Prototype - name: ~ # Required fieldType: ~ # One of "input"; "textarea"; "select"; "datetime"; "date"; "user"; "checkbox", Required title: ~ required: false setterFn: ~ fieldTypeSettings: [] # Configure the output of custom HTML for a transition. customHtml: # Define a custom service for rendering custom HTML within the note modal. service: 'App\Service\Workflow\CustomHtmlService' # Set position of custom HTML inside modal (top, center, bottom; default=top). position: 'top'
Available options
[ -0.3993205726146698, -0.015906596556305885, -0.14640991389751434, -0.14009001851081848, -0.3316364288330078, -0.4510157108306885, 0.5256007313728333, 0.3046604096889496, 0.18693245947360992, 0.1932431310415268, -0.13435645401477814, 0.5387269854545593, -0.07579527050256729, 0.3875855505466...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#marking-stores
Marking Stores The Pimcore workflow engine provides several different ways how to store the actual places of a subject. These are represented of the following marking store types.
Marking Stores
[ 0.025838080793619156, -0.21971367299556732, -0.09054411947727203, 0.08872019499540329, -0.11068837344646454, -0.23746326565742493, 0.4193389117717743, -0.11757427453994751, -0.13765136897563934, 0.08397090435028076, -0.09820620715618134, 0.42531460523605347, 0.17964252829551697, 0.08706709...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#state_table-(default)
state_table (default) This is the default marking store. The place information is stored in the element_workfow_state table. This would be the best option for Assets and Documents. For data objects the other marking store options might be the better choice as the data would be stored directly in the data object model as attributes.
state_table (default)
[ -0.04826698079705238, -0.054133057594299316, -0.17138533294200897, 0.0952589213848114, -0.039363861083984375, -0.07773739844560623, 0.34943410754203796, 0.3129178583621979, 0.3798567056655884, 0.20029646158218384, -0.08684702217578888, 0.19828522205352783, 0.25036102533340454, 0.3446557521...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#configuration-example
Configuration Example marking_store: type: state_table
Configuration Example
[ -0.31033268570899963, -0.12976577877998352, -0.15999539196491241, 0.08095993101596832, 0.2751658260822296, 0.23568905889987946, 0.28159600496292114, 0.5714023113250732, 0.28044384717941284, 0.02256835624575615, 0.19813908636569977, 0.39082661271095276, 0.10365461558103561, 0.57140690088272...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#single_state
single_state Stores the place in a attribute of the subject (calls the setter method). Can be used if a model cannot be in more then one state at the same time. This is the default single_state marking store provided by the Symfony framework. For data objects a select field (or maybe input field) would be the right Pimcore field to store the places when the single_state marking store is used.
single_state
[ -0.08734121173620224, -0.13185952603816986, -0.052052244544029236, 0.10980258882045746, -0.059217896312475204, -0.30436185002326965, 0.46810802817344666, 0.033911578357219696, 0.1478503793478012, 0.1931949108839035, 0.030527623370289803, 0.16602939367294312, 0.31427520513534546, 0.06204193...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#configuration-example
Configuration Example marking_store: type: single_state arguments: - workflowState
Configuration Example
[ -0.3869648575782776, -0.2686597406864166, -0.15089553594589233, -0.30519863963127136, 0.23878733813762665, -0.036914292722940445, 0.6188995242118835, 0.41522976756095886, 0.29062169790267944, 0.03620566800236702, 0.3640669882297516, 0.44441792368888855, -0.03035772778093815, 0.356625407934...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#multiple_state
multiple_state Same as single_state but can be used if the subject can be in more then one state at the same time. Note: this cannot be used in combination with data object multiselect fields - use data_object_multiple_state instead.
multiple_state
[ -0.2622418701648712, -0.428060919046402, -0.2050483673810959, -0.0701327845454216, -0.24396735429763794, -0.2920265197753906, 0.30558985471725464, 0.2989707887172699, 0.051714781671762466, 0.14899499714374542, 0.11447461694478989, 0.2906458079814911, -0.13110880553722382, 0.237838193774223...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#configuration-example
Configuration Example marking_store: type: multiple_state arguments: - workflowState
Configuration Example
[ -0.3790198564529419, -0.31405895948410034, -0.18721634149551392, -0.1069520115852356, 0.15445521473884583, -0.048374004662036896, 0.5948996543884277, 0.3937090039253235, 0.37394922971725464, -0.03506527841091156, 0.28133171796798706, 0.33135515451431274, 0.02344701997935772, 0.403744399547...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#data_object_multiple_state
data_object_multiple_state Can be used to store mutliple places in a data object multiselect field.
data_object_multiple_state
[ -0.1870391070842743, -0.1534697711467743, -0.2822463810443878, 0.16012141108512878, -0.054628293961286545, -0.35712581872940063, 0.25557833909988403, 0.06412453949451447, 0.14833739399909973, 0.05756555497646332, -0.057046957314014435, 0.3140594959259033, 0.03369375690817833, 0.40206345915...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#configuration-example
Configuration Example marking_store: type: data_object_multiple_state arguments: - workflowState
Configuration Example
[ -0.34118127822875977, -0.22080999612808228, -0.18191498517990112, -0.03265029191970825, 0.1694178283214569, -0.07730954140424728, 0.5650784969329834, 0.38941624760627747, 0.3019312024116516, -0.012580829672515392, 0.27534204721450806, 0.3874988853931427, 0.006528276018798351, 0.45644003152...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#data_object_splitted_state-(data-objects-only)
data_object_splitted_state (data objects only) Works similar to single_state and data_object_multiple_state but is able to store different places in different Pimcore data object attributes. Therefore it's needed to configure a mapping between places and data object attribute names.
data_object_splitted_state (data objects only)
[ -0.25373226404190063, -0.2038334459066391, -0.19131667912006378, 0.19268260896205902, 0.1703118085861206, -0.4878041744232178, 0.3962118327617645, 0.18515518307685852, -0.09935425221920013, 0.3047284185886383, -0.5315132141113281, 0.3427715003490448, 0.2515328526496887, 0.3388938009738922,...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#configuration-example
Configuration Example In the following example places which are related to the text of the data object are stored in the workflowStateText attribute whereas image related places are stored in workflowStateImages: marking_store: type: data_object_splitted_state arguments: - text_open: workflowStateText text_finished: workflowStateText text_released: workflowStateText images_open: workflowStateImages images_finished: workflowStateImages images_released: workflowStateImages
Configuration Example
[ -0.22106094658374786, -0.17459693551063538, -0.2102542668581009, 0.07782301306724548, -0.04199893772602081, -0.21864555776119232, 0.5303647518157959, 0.1219133734703064, 0.19869571924209595, 0.08918177336454391, -0.2530602216720581, 0.19735205173492432, 0.22158077359199524, 0.1457137018442...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Marking_Stores#options-provider-(for-single_state,-data_object_multiple_state-and-data_object_splitted_state)
Options provider (for single_state, data_object_multiple_state and data_object_splitted_state) If data object attributes (select or multiselect) are used to store the places a special options provider can be used to automatically provide the correct select options. Just setup @pimcore.workflow.place-options-provider as options provider and the workflow name as options provider data in the used data object attribute. This options provider adds the places in a nicely formatted way:
Options provider (for single_state, data_object_multiple_state and data_object_splitted_state)
[ -0.3381858468055725, 0.03117951564490795, -0.1496397852897644, -0.19113841652870178, -0.0986611470580101, -0.4525538682937622, 0.26762303709983826, 0.1608823835849762, 0.05219530314207077, 0.2715505063533783, -0.09337183833122253, 0.6329429745674133, 0.2656030058860779, 0.33466777205467224...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#support-strategies
Support Strategies The workflow engine offers several different ways to define which entities are supported by the configured workflow. Important: The different configuration ways cannot be combined. It's necessary to choose one.
Support Strategies
[ -0.07105415314435959, -0.2037084549665451, -0.1534924954175949, -0.14964845776557922, 0.029682813212275505, -0.32709479331970215, 0.46888625621795654, -0.017215628176927567, -0.00595024973154068, 0.14944639801979065, 0.16682042181491852, 0.11045923829078674, -0.10685011744499207, 0.3069224...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#supports
Supports The simplest way is to use supports. A single entity class name or an array of entity class names can be defined.
Supports
[ -0.25880637764930725, -0.050790365785360336, -0.23918280005455017, 0.13196629285812378, 0.18975628912448883, -0.2039330154657364, 0.2616896331310272, 0.3060387074947357, 0.18984399735927582, 0.5660844445228577, 0.1027459129691124, 0.04825685918331146, -0.1577923595905304, 0.116411305963993...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#configuration-examples
Configuration Examples supports: Pimcore\Model\DataObject\Product supports: - Pimcore\Model\DataObject\Product - Pimcore\Model\DataObject\ProductCategory
Configuration Examples
[ -0.32129889726638794, -0.017913417890667915, -0.1456587016582489, -0.08018658310174942, 0.25785523653030396, -0.20747114717960358, 0.44663867354393005, 0.09814592450857162, -0.3881493806838989, 0.013258714228868484, -0.1463152915239334, 0.5535714030265808, -0.1475093960762024, 0.4244626164...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#expression-support-strategy
Expression Support Strategy The expression support strategy can be used if a workflow should apply to a entity under certain circumstances only. It's possible to define a symfony expression - the workflow then applies only if the expression is valid.
Expression Support Strategy
[ -0.11527517437934875, -0.0189546849578619, -0.04589880630373955, -0.48763370513916016, -0.19864630699157715, -0.5597432255744934, 0.46345263719558716, 0.2261853814125061, -0.13955338299274445, 0.32475754618644714, 0.31828805804252625, 0.21914243698120117, -0.10054828226566315, 0.2842756211...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#configuration-example
Configuration Example In the following example the workflow applies to products where the attribute "productType" is equal to "article". support_strategy: type: expression arguments: - Pimcore\Model\DataObject\Product - "subject.getProductType() == 'article'"
Configuration Example
[ -0.07691330462694168, -0.38532504439353943, -0.136026069521904, -0.31619852781295776, -0.06209385395050049, -0.4330328106880188, 0.5910347104072571, 0.1336621642112732, -0.2779713571071625, 0.07457389682531357, 0.2726927399635315, 0.6821146607398987, 0.11257284134626389, 0.7101864218711853...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#custom-support-strategy
Custom Support Strategy If a very specific logic is needed it's possible to add a service which implements the Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface.
Custom Support Strategy
[ -0.16668589413166046, 0.07912952452898026, -0.22113169729709625, -0.45231807231903076, -0.1697162389755249, -0.47429364919662476, 0.430979460477829, 0.22859913110733032, 0.1313181221485138, 0.3047659695148468, 0.20827887952327728, 0.12797459959983826, -0.12086530774831772, 0.32255995273590...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#configuration-example
Configuration Example support_strategy: service: App\Workflow\SupportStrategy
Configuration Example
[ -0.06015850603580475, -0.38251373171806335, -0.30128931999206543, -0.3996417820453644, 0.255370557308197, -0.12372789531946182, 0.25995028018951416, 0.18523697555065155, 0.0007081350195221603, 0.17123058438301086, 0.5184795260429382, 0.2547197937965393, -0.15531837940216064, 0.631053805351...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Support_Strategies#example-implementation-(needs-to-be-registered-in-the-service-container)
Example Implementation (needs to be registered in the service container) <?php namespace App\Workflow; use Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface; use Symfony\Component\Workflow\WorkflowInterface; class SupportStrategy implements WorkflowSupportStrategyInterface { public function supports(WorkflowInterface $workflow, object $subject): bool { if ($subject instanceof \Pimcore\Model\DataObject\Test) { return true; } return false; } }
Example Implementation (needs to be registered in the service container)
[ -0.2239072620868683, -0.0784890353679657, -0.192257821559906, -0.2947358191013336, -0.13521505892276764, -0.5273791551589966, 0.4124888479709625, 0.27598971128463745, 0.1471853405237198, 0.3856840431690216, 0.29381874203681946, 0.30065590143203735, -0.2754608392715454, 0.312494695186615, ...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Permissions#modifying-pimcore-permissions-based-on-workflow-places
Modifying Pimcore Permissions Based On Workflow Places As listed in the configuration details section it's possible to modify the Pimcore element permissions based on the current workflow place. It's possible to add multiple permission configurations based on conditions. The first entry where the condition is valid will be used.
Modifying Pimcore Permissions Based On Workflow Places
[ -0.13437634706497192, 0.0010976501507684588, -0.21919909119606018, -0.1475754827260971, -0.14882546663284302, -0.4422426223754883, 0.39905738830566406, 0.02036178857088089, 0.035847652703523636, 0.2539607882499695, -0.3831329941749573, 0.30447742342948914, 0.12906654179096222, 0.2482802420...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Permissions#configuration-examples
Configuration Examples Pimcore admins are allowed to publish and delete the object but for all other users it will be suppressed: places: closed: permissions: - condition: is_fully_authenticated() and 'ROLE_PIMCORE_ADMIN' in role_names publish: true delete: true - publish: false delete: false Pimcore admins are allowed to modify (save, publish,...) the object but for all other users the save and delete button will be hidden. modify is a short hand for save, publish, unpublish, delete and rename: places: closed: permissions: - condition: is_fully_authenticated() and 'ROLE_PIMCORE_ADMIN' in role_names modify: true - modify: false If multiple places provide a valid permission configuration the one with the highest priority will be used. The priority is based on the workflow priority (the workflow with the higher priority setting will win). Within a single workflow the order within the places section of the configuration file will be used.
Configuration Examples
[ 0.25453758239746094, -0.0573749840259552, -0.09412495046854019, 0.03402071073651314, -0.16715526580810547, -0.4745352864265442, 0.17584727704524994, -0.33005452156066895, -0.23197966814041138, 0.22252307832241058, -0.17659515142440796, 0.27241602540016174, 0.20342928171157837, -0.034578755...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#simple-workflow-tutorial
Simple Workflow Tutorial Let's make a one truly simple example workflow for product objects.
Simple Workflow Tutorial
[ 0.05056793987751007, -0.35250717401504517, -0.29951828718185425, -0.3178788721561432, -0.11146948486566544, -0.33817461133003235, 0.5197221636772156, 0.02412361279129982, -0.05418352410197258, 0.2715749144554138, 0.2984154522418976, 0.3969000279903412, -0.161577969789505, 0.428283721208572...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#create-a-class-and-custom-layouts
Create a class and custom layouts I've created the really simple product class (sku, localized name, localized picture and localized description, price and quantity). Next, I added four custom layouts which later I will assign to the specific statuses. newProduct layout with ID = 1 fillContents layout with ID = 2 updatePicture layout with ID = 3 validateQtyPrice layout with ID = 4
Create a class and custom layouts
[ -0.01656987890601158, -0.31495267152786255, -0.28209537267684937, 0.1702665090560913, -0.11359575390815735, -0.14629384875297546, 0.4364170730113983, 0.16486066579818726, -0.21118028461933136, 0.30391135811805725, -0.2072039395570755, 0.10726677626371384, 0.1958434134721756, 0.555186092853...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#the-workflow-declaration
The workflow declaration Now create the base configuration in config/config.yaml pimcore: workflows: workflow: label: 'Product Workflow' type: 'state_machine' supports: - 'Pimcore\Model\DataObject\Product' places: #TODO transitions: #TODO As you can see, the workflow is called Product workflow, we haven't added any places and transitions yet. The workflow is available only for instances of Pimcore\Model\DataObject\Product objects. We use the workflow type state_machine, so one transition can start from multiple places.
The workflow declaration
[ -0.22360852360725403, -0.30838924646377563, -0.08011502772569656, -0.5920732021331787, 0.019698314368724823, -0.3870580494403839, 0.4860806465148926, 0.16094191372394562, -0.05698717385530472, 0.08998145163059235, 0.03383373096585274, 0.6955770254135132, -0.06863916665315628, 0.50087785720...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#specify-places
Specify places Now it's the best time to define some places for products. What I want to achieve? Let's suppose that our new products are integrated with an external system and new positions comes to Pimcore as empty objects only with SKU. I need to have ability to decide which products would be used in Pimcore, the rest of products I want to reject. To achieve that requirement, I have to make (at least) three places. new - for the newest products rejected - for products which I'm not going to use in the future. Also I would like to add some note with a reason here. update content - for products I would like to publish (...) places: new: label: 'New product' color: '#377ea9' permissions: - objectLayout: 1 rejected: label: 'Rejected product' color: '#28a013' update_content: label: 'Update Content' title: 'Updating content step' color: '#d9ef36' permissions: - objectLayout: 2 (...) As you can see I used objectLayout key to define which custom layout would be used with the new status.
Specify places
[ 0.34683459997177124, -0.6231310963630676, -0.10872527211904526, -0.12776733934879303, -0.08745314925909042, -0.6668672561645508, 0.19722740352153778, -0.07007062435150146, 0.08176741749048233, 0.07558836787939072, -0.2656658887863159, 0.31124696135520935, 0.14182916283607483, 0.31315627694...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#specify-the-first-transitions
Specify the first transitions As an administrator, I can decide which product can be processed and which shouldn't be. To do so, I need to add some actions. reject product - to change the status for products I don't want to use start processing - to move the product to the processing step (...) transitions: reject_product: from: new to: rejected options: label: 'Reject the product' notes: commentEnabled: true commentRequired: true start_processing: from: new to: update_content options: label: 'Start processing the product' (...)
Specify the first transitions
[ 0.2099435031414032, -0.5429949760437012, -0.20169147849082947, -0.26150429248809814, 0.008141249418258667, -0.3718245029449463, 0.07897114008665085, 0.1440519094467163, 0.17479552328586578, -0.08858788013458252, 0.19155311584472656, 0.17685505747795105, -0.19032318890094757, 0.422807246446...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#more-statuses-actions-and-definitions
More statuses actions and definitions Let's add 4 more places for updating content updating the content updating the picture updating the price and stock mark content as a ready - move product back to the administrator Let's add few new rows in the configuration file (...) places: (...) update_picture: label: 'Update Product Picture' title: 'Update the product picture' color: '#d9ef36' permissions: - objectLayout: 3 validate_stock_and_price: label: 'Validate Stock + Price' title: 'Check the quantity and the price' color: '#d9ef36' permissions: - objectLayout: 4 content_prepared: label: 'Content Prepared' title: 'Content ready to publish' color: '#28a013' (...) transitions: (...) content_updated: from: update_content to: update_picture options: label: 'Content up-to-date' notes: commentEnabled: true commentRequired: false picture_updated: from: update_picture to: validate_stock_and_price options: label: 'Picture up-to-date' notes: commentEnabled: true commentRequired: false content_ready: from: validate_stock_and_price to: content_prepared options: label: 'Content is ready to publish' (...)
More statuses actions and definitions
[ -0.19929403066635132, -0.2410651296377182, -0.30984407663345337, -0.1176925078034401, 0.07383289933204651, -0.22793099284172058, 0.13121241331100464, 0.37765389680862427, -0.22526481747627258, 0.21480515599250793, -0.02222413383424282, 0.31335949897766113, 0.024715878069400787, 0.267551422...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#last-actions:-publish-or-rollback
Last actions: publish or rollback At the final stage of the workflow I would like to have three choices Publish the product (with additional field called "timeWorked") Start workflow from the beginning Reject the product (with note) We've already made the reject and start processing transition, the only thing here is to add an additional from place. This can be done because we have workflow type state_machine activated, here our modified transition definitions. (...) transitions: reject_product: from: [new, content_prepared] to: rejected options: label: 'Reject the product' notes: commentEnabled: true commentRequired: true start_processing: from: [new, content_prepared] to: update_content options: label: 'Start processing the product' notes: commentEnabled: true commentRequired: false (...) The last one we need is publishing - place and transition - that is only allowed to a certain role. (...) places: (...) accepted: label: 'Accepted product' color: '#28a013' (...) And, the transition with a "timeWorked" field. (...) transitions: (...) publish: from: content_prepared to: accepted guard: "is_fully_authenticated() and is_granted('ROLE_PIMCORE_ADMIN')" options: label: 'Publish the product' notes: commentEnabled: true commentRequired: true additionalFields: - name: 'timeWorked' fieldType: 'input' title: 'Time Spent' required: true (...)
Last actions: publish or rollback
[ 0.13209080696105957, -0.3077371120452881, -0.11261362582445145, -0.22009703516960144, -0.11796779185533524, -0.5357242226600647, 0.16149449348449707, 0.1558772474527359, -0.06215968728065491, -0.07796114683151245, 0.23602209985256195, 0.47665226459503174, -0.05048403888940811, 0.4052957594...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#workflow-in-action
Workflow in action Below, you can find showcase of the workflow I've just prepared. Status Screenshot Initial status when new object comes into the system Update Content Update Picture Validate Price and Stock Content is ready Publish the Product
Workflow in action
[ -0.11537501960992813, -0.25043487548828125, -0.25985780358314514, -0.38922119140625, -0.19605015218257904, -0.40132972598075867, 0.3091900050640106, 0.15291079878807068, -0.09199188649654388, 0.11355829238891602, 0.19143721461296082, 0.3806633949279785, -0.08214863389730453, 0.489631146192...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Tutorial#check-the-history
Check the history In the "Notes & Events" tab, there is a list with every action used on the object via the Workflow module.
Check the history
[ -0.23906953632831573, -0.22794659435749054, -0.24019314348697662, 0.017629869282245636, -0.15242516994476318, -0.2677789032459259, 0.3875415623188019, 0.14292706549167633, 0.0402500182390213, 0.2107352316379547, 0.17165201902389526, 0.2557225525379181, -0.2062368392944336, -0.2438718974590...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Report#workflow-reporting
Workflow Reporting Depending on the marking store of workflows, different ways of Workflow Reporting are available. For details see marking store docs.
Workflow Reporting
[ -0.1669110506772995, -0.0757891833782196, -0.234331414103508, 0.09854451566934586, -0.1904032677412033, -0.3876788318157196, 0.5731351971626282, -0.14752407371997833, 0.04230828955769539, 0.12177448719739914, 0.13269996643066406, 0.22625569999217987, 0.05026788264513016, 0.1358290910720825...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Report#using-state_table-and-custom-reports
Using state_table and Custom Reports You can easily use the custom reports to make workflow place reporting, filtering, exporting and directly open related elements. This way, you can follow and monitor workflows and the progress of document, asset and object.
Using state_table and Custom Reports
[ -0.5264100432395935, 0.07572263479232788, -0.28624916076660156, -0.03940226510167122, -0.404904305934906, -0.14979970455169678, 0.31427472829818726, 0.6156070232391357, 0.21188588440418243, 0.12471427768468857, -0.2547861933708191, 0.2778281271457672, 0.18902935087680817, 0.530893325805664...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Report#create-a-custom-report-for-objects
Create a custom report for objects First, you just have to create a new empty custom report, please see: custom reports After creating it, you can configure it like this for the Source Definition, Column Configuration and Chart Settings: Save it and you are ready to use it! You can filter globally by state and status, order and filter the columns and export results Here is an example of rendered workflow custom report:
Create a custom report for objects
[ -0.2546107769012451, -0.04412435367703438, -0.23738990724086761, 0.020675700157880783, -0.15783514082431793, -0.2421198934316635, 0.33386093378067017, 0.4283486604690552, 0.26558247208595276, 0.34286555647850037, -0.10579361766576767, 0.32929569482803345, 0.002189838793128729, 0.4636507928...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Workflow_Report#using-single_state,-data_object_multiple_state-and-data_object_splitted_state-together-with-object-grid
Using single_state, data_object_multiple_state and data_object_splitted_state together with Object Grid Since single_state (and others) stores the place information into data object attributes, Pimcore default object grids can be used to do workflow reporting on Pimcore Objects. Just create a corresponding grid configuration and use default filtering and sorting functionality. Additionally extensions like Advanced Object Search can be used to create saved searches with predefined filters.
Using single_state, data_object_multiple_state and data_object_splitted_state together with Object Grid
[ -0.34688490629196167, -0.06974409520626068, -0.1097051128745079, 0.0703001320362091, -0.1935918927192688, -0.45711633563041687, 0.3682008385658264, 0.309109628200531, 0.05151565745472908, 0.20090153813362122, -0.3774133324623108, 0.32202935218811035, -0.04271293431520462, 0.482954919338226...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Working_with_PHP_API#working-with-php-api
Working With PHP API The Pimcore workflow management can also be used via PHP API.
Working With PHP API
[ -0.3422221541404724, -0.08248007297515869, -0.3687058389186859, -0.2082446962594986, -0.14958485960960388, -0.45788395404815674, 0.25114765763282776, 0.04126087948679924, -0.12097764760255814, 0.301098495721817, 0.18665799498558044, 0.3750791847705841, -0.16442987322807312, 0.5339374542236...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Working_with_PHP_API#using-workflow-api-to-modify-places-of-elements
Using Workflow API to modify Places of Elements Since the Pimcore workflow management is based on the Symfony workflow component, also its API can be used the same way. For details see Symfony docs. Additionally Pimcore provides the \Pimcore\Workflow\Manager, which provides additional functionality for working with the workflow management - like additional methods for apply places with additional data (applyWithAdditionalData()) and apply global actions (applyGlobalAction()). See following example how to interact with workflows with PHP API. /** * $object ... your element, e.g. a Pimcore data object * $workflowRegistry Symfony\Component\Workflow\Registry from Symfony container */ $workflow = $workflowRegistry->get($object, 'workflow'); if($workflow->can($object, 'content_ready')) { //modify workflow via Symfony API and without saving additional data $workflow->apply($object, 'content_ready'); //make sure you save the workflow subject afterwards if any data was changed during transition //e.g. by a marking store $object->save(); } if($workflow->can($object, 'publish')) { //modify workflow with Pimcore Workflow Manager - notes are written with additional data $additionalData = [ NotesSubscriber::ADDITIONAL_DATA_NOTES_COMMENT => 'this is some additional note', NotesSubscriber::ADDITIONAL_DATA_NOTES_ADDITIONAL_FIELDS => [ 'timeWorked' => 20 ] ]; /** * $workflowManager Pimcore\Workflow\Manager from Symfony container */ //last parameter defines if workflow subject should be saved after transition $workflowManager->applyWithAdditionalData($workflow, $object, 'publish', $additionalData, true); }
Using Workflow API to modify Places of Elements
[ -0.04355959966778755, 0.11298654973506927, -0.21048952639102936, -0.20864924788475037, -0.10139714181423187, -0.40476566553115845, 0.23524485528469086, 0.12117613106966019, -0.11951214075088501, 0.2771701514720917, -0.022694148123264313, 0.4660061299800873, 0.15753015875816345, 0.010486639...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Working_with_PHP_API#using-events-for-additional-functionality
Using Events for Additional Functionality Symfony workflow module comes with a bunch of events that can be used for customizing and extending default workflow functionality. See Symfony docs for details. In addition to the Symfony events, Pimcore provides two additional events for global actions: pimcore.workflow.preGlobalAction pimcore.workflow.postGlobalAction See WorkflowEvents for details.
Using Events for Additional Functionality
[ -0.417184978723526, -0.16400332748889923, -0.13430677354335785, -0.27450254559516907, -0.2852805554866791, -0.3857617974281311, 0.17982853949069977, 0.0445157065987587, 0.05787307769060135, 0.29596826434135437, 0.15105699002742767, 0.41296762228012085, -0.06639871001243591, 0.2402885705232...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management/Working_with_PHP_API#using-additional-data-in-events
Using Additional Data in Events If additional data fields are defined in the transition configuration, it's possible to retrieve those data on event listener functions. See following example how to interact with additional data on transition events. Let's first define an additional field in the workflow configuration. transitions: close_product: from: open to: closed options: label: close product notes: commentEnabled: 1 commentRequired: 1 additionalFields: - name: mySelect title: please select a type fieldType: select fieldTypeSettings: options: - key: Option A value: a - key: Option B value: b - key: Option C value: c Then, we should define the transition event on services.yaml. services: App\EventListener\WorkflowsEventListener: tags: - { name: kernel.event_listener, event: workflow.projectWorkflow.transition.close_product, method: onCloseProduct } The additional data will be then available in the transition event <?php namespace App\EventListener; use Symfony\Component\Workflow\Event\TransitionEvent; class WorkflowsEventListener { public function onCloseProduct(TransitionEvent $event): void { $context = $event->getContext(); $additionalData = $context["additional"]; $mySelectValue = $additionalData["mySelect"];; // do something with the value } }
Using Additional Data in Events
[ -0.447007954120636, -0.032773490995168686, -0.06661713123321533, 0.08770352602005005, -0.15031418204307556, -0.4730081260204315, 0.42258426547050476, 0.11742586642503738, -0.09952973574399948, 0.20880861580371857, -0.07225155085325241, 0.5139051675796509, -0.04494355618953705, 0.2125723659...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#workflow-management
Workflow Management
Workflow Management
[ 0.010760152712464333, -0.48473450541496277, -0.3897644281387329, -0.12250115722417831, -0.2011806070804596, -0.2804160714149475, 0.38764670491218567, -0.07141243666410446, 0.05249852314591408, 0.09352774918079376, 0.2300402820110321, 0.10251867771148682, -0.27462881803512573, 0.34642401337...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#general
General Pimcore Workflow Management provides configuration of multiple workflows on Pimcore elements (assets, documents, data objects) to support data maintenance processes, element life cycles and various other processes. It is based on the Symfony workflow component and extends it with a few Pimcore specific features. So, before using Pimcore Workflow Management it makes sense to know the basics of Symfony workflow component.
General
[ -0.16305363178253174, -0.3263365924358368, -0.21221011877059937, -0.13824966549873352, -0.14389531314373016, -0.21296799182891846, 0.3128860592842102, 0.005608127918094397, -0.22045309841632843, 0.08386612683534622, -0.02478739619255066, 0.2580767869949341, 0.09617862850427628, 0.195119827...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#concepts
Concepts Workflow A workflow is a model of a process an element in Pimcore goes through. It consists of places, transitions, a marking store, global actions and a couple of additional configuration options. Each element can be in multiple workflows simultaneously. Workflow Type 'Workflow' Workflow type workflow describes the default type of workflows and allows to model a workflow net which is a subclass of a petri net. It models a process of an element and allows multiple places simultaneously for this element. Workflow Type 'State Machine' A state machine is a subset of a workflow and its purpose is to hold a state of your model. The most important restriction is that a state machine cannot be in more than one place simultaneously. For further details see also Symfony docs. Place A place is a step in the workflow and describes a characteristic or a status of an element - for example in progress, product attributes defined, copyright available, element ready for publish, etc. Depending on the place an element may appear in a specific view (e.g. custom layout for data objects) and may have certain special permissions (e.g. finished elements cannot be modified anymore). Marking Store The marking store stores the current place(s) for each element. Pimcore ships with a couple of stores that can be configured in workflow configuration. Transition A transition describes the action to get from one place to another. Transitions are allowed (or not) depending on additional criteria (transition guards) and may require additional notes and information entered by user. Transition Guard Define criteria that define if a transition is currently allowed or not. Global Action While transitions are only available when the element is in a certain place, global actions are available at every place. Besides that, they are very similar to transitions.
Concepts
[ -0.01854942925274372, -0.432897686958313, -0.07799402624368668, -0.06616207212209702, -0.1475595235824585, -0.42266231775283813, 0.3420459032058716, 0.05786183476448059, 0.0394582562148571, 0.09245523065328598, -0.17878654599189758, 0.13264980912208557, 0.17309756577014923, 0.3333107233047...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#configuration
Configuration The workflow configuration takes place in the Symfony configuration tree in the Pimcore namespace. For details of configuration options see inline comments and documentation (call command bin/console config:dump-reference PimcoreCoreBundle) or Configuration Details.
Configuration
[ -0.15662837028503418, -0.09003780782222748, -0.12559248507022858, -0.12877482175827026, -0.29169341921806335, -0.2977471947669983, 0.2837517261505127, -0.14622658491134644, -0.2305198311805725, 0.3048800230026245, 0.027123410254716873, 0.3710799217224121, 0.37377825379371643, 0.23782408237...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#events
Events The Pimcore workflow management fires several events that can be used to customize and extend functionality. For details see Working with PHP API.
Events
[ -0.29244479537010193, -0.16317443549633026, -0.29016295075416565, -0.152168408036232, -0.19053177535533905, -0.3347199857234955, 0.04208069667220116, -0.04535716027021408, -0.20278753340244293, 0.2844484746456146, 0.23458422720432281, 0.46590787172317505, 0.01563373953104019, 0.34440001845...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#user-notifications
User Notifications Notifications (via email or Pimcore notifications) can be configured to be sent to users when an transition takes place. To do this simply specify an array of user(s) or role(s) that you would like to be notified in options section of the transition definition. Roles will send an notification to every user with that role. ... transitions: myTransition: options: notificationSettings: - # A symfony expression can be configured here. All sets of notification which are matching the condition will be used. condition: "" # optional some condition that should apply for this notification setting to be executed # Send a email notification to a list of users (user names) when the transition get's applied notifyUsers: ['admin'] # Send a email notification to a list of user roles (role names) when the transition get's applied notifyRoles: ['projectmanagers', 'admins'] # Define which channel notification should be sent to, possible values "mail" and "pimcore_notification", default value is "mail". channelType: - mail - pimcore_notification # Type of mail source. mailType: 'template' # this is the default value, One of "template"; "pimcore_document" # Path to mail source - either Symfony path to template or fullpath to Pimcore document. # Optional use %%_locale%% as placeholder for language. mailPath: '@PimcoreCore/Workflow/NotificationEmail/notificationEmail.html.twig' #this is the value ... Multiple notification settings with conditions allow sophisticated notifications to be configured for each transition. To customize the e-mail template, following options are available: Overwrite the template @PimcoreCore/Workflow/NotificationEmail/notificationEmail.html.twig or configure your own template path in settings. Default parameters available in the template are subjectType, subject, action, workflow, workflowName, deeplink, note_description, translator, lang. If additional parameters are required, overwrite the service Pimcore\Workflow\Notification\NotificationEmailService. Configure a Pimcore Mail Document and use full power of Pimcore Mail Documents, with Controller, Action, Placeholders, etc. In the mail document same parameters as above are available. If more custom notifications are necessary, use custom event listeners.
User Notifications
[ -0.2638009786605835, 0.03246300667524338, -0.08469504117965698, -0.0822829157114029, 0.05548258498311043, -0.40872636437416077, 0.4393364489078522, -0.1476723700761795, -0.21084314584732056, 0.26762256026268005, 0.18190547823905945, 0.34370771050453186, -0.33791401982307434, 0.147528156638...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#workflow-history
Workflow History In the "Notes & Events" tab, there is a list with every action used on the object via the Workflow module.
Workflow History
[ -0.2068125158548355, -0.18765148520469666, -0.23943673074245453, -0.03910059481859207, -0.224106565117836, -0.1827322244644165, 0.3373594582080841, 0.022782711312174797, 0.09785431623458862, 0.15701617300510406, 0.16968737542629242, 0.24735097587108612, -0.3209611177444458, -0.235607773065...
https://pimcore.com/docs/platform//Pimcore/Workflow_Management#workflow-overview
Workflow Overview If workflows are configured for a Pimcore element, an additional tab with workflow details like all configured workflows, their current places and a workflow graph is added to Pimcore element detail page. To render the graph, graphviz is needed as additional system requirement.
Workflow Overview
[ -0.4011875092983246, -0.5378431677818298, -0.18645282089710236, -0.1403907686471939, -0.2536449730396271, -0.05066745728254318, 0.33585622906684875, 0.05258072540163994, 0.09930010139942169, 0.32331007719039917, -0.11195442080497742, 0.49019908905029297, 0.4126465320587158, 0.5299241542816...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#versioning
Versioning
Versioning
[ -0.10611114650964737, -0.37455397844314575, -0.2509562075138092, -0.14618191123008728, -0.18721835315227509, -0.03513297811150551, -0.007362000178545713, 0.17322057485580444, -0.3621934652328491, 0.24616287648677826, 0.100263811647892, -0.061397891491651535, -0.17781409621238708, 0.1392419...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#general
General All contents in Pimcore (documents, assets and objects) are versioned. You can have as many versions as you want. On each change a new version of the element is created. For example, if you would like to find the version history in objects you have to choose Versions tab. There you can see a list of changes, what is the difference between revisions and you can choose which version should be published.
General
[ -0.12891234457492828, -0.26871228218078613, -0.20974646508693695, 0.2740424573421478, -0.27097180485725403, -0.2896007299423218, 0.046279799193143845, 0.18095193803310394, -0.3304438292980194, 0.24677196145057678, -0.2611452043056488, 0.16858583688735962, 0.32371121644973755, -0.0247412510...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#settings
Settings You can configure the versioning behavior in the Settings -> System Settings -> (Documents, Assets, Objects)
Settings
[ -0.28502219915390015, -0.031612999737262726, -0.13872450590133667, -0.10809720307588577, -0.1108928769826889, -0.1767405867576599, 0.2612755298614502, 0.2947287857532501, -0.09220360964536667, 0.30377012491226196, 0.10898585617542267, 0.04948586970567703, -0.011670743115246296, -0.13499508...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#version-storage
Version storage For every version the metadata and, if present, binary data is stored. Since the amount of information can turn out to be too big real quick, Pimcore provides 3 different ways to handle the storage of version data.
Version storage
[ -0.033716268837451935, -0.1448116898536682, -0.1866024136543274, 0.37315401434898376, -0.09512605518102646, -0.09551718086004257, -0.035296861082315445, -0.09067627042531967, -0.4371335804462433, 0.2494785487651825, -0.1613268107175827, 0.04758083447813988, 0.06519880145788193, 0.116155475...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#configuration
Configuration
Configuration
[ -0.15416096150875092, -0.7155073881149292, -0.32192933559417725, 0.23793049156665802, 0.2283698320388794, -0.04995255544781685, 0.20479941368103027, -0.15104302763938904, -0.31000185012817383, 0.35477015376091003, -0.019372452050447464, 0.01929520256817341, -0.07433187961578369, 0.22464549...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#filesystem
Filesystem This is the default setting. To store version data in the filesystem, use the FileSystemStorageAdapter. Pimcore\Model\Version\Adapter\VersionStorageAdapterInterface: public: true alias: Pimcore\Model\Version\Adapter\FileSystemVersionStorageAdapter Pimcore\Model\Version\Adapter\FileSystemVersionStorageAdapter: ~
Filesystem
[ -0.408037930727005, -0.22327011823654175, -0.16651204228401184, -0.0834418311715126, -0.05634516850113869, -0.17197571694850922, 0.22561556100845337, 0.097690649330616, -0.2140202522277832, 0.3955896198749542, -0.05101931467652321, 0.2947578430175781, 0.13864871859550476, 0.071653120219707...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#database
Database To store the version data in a database, use the DatabaseVersionStorageAdapter service. You need to pass a configured doctrine database connection as an argument. Therefore, you are able to provide a connection to a completely separate database which may contains only the version data. Pimcore\Model\Version\Adapter\VersionStorageAdapterInterface: public: true alias: Pimcore\Model\Version\Adapter\DatabaseVersionStorageAdapter Pimcore\Model\Version\Adapter\DatabaseVersionStorageAdapter: arguments: $database_connection: '@doctrine.dbal.versioning_connection' The database needs to contain a table called versionsData. The following script can be used to create the table including the necessary columns. CREATE TABLE `versionsData` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `cid` int(11) unsigned DEFAULT NULL, `ctype` enum('document','asset','object') DEFAULT NULL, `metaData` longblob DEFAULT NULL, `binaryData` longblob DEFAULT NULL, PRIMARY KEY (`id`) )
Database
[ -0.4083579182624817, 0.285561203956604, -0.1856059581041336, 0.10040014237165451, -0.14932939410209656, -0.012192909605801105, -0.19036227464675903, 0.3642747402191162, -0.46423840522766113, 0.17846651375293732, -0.12303479015827179, 0.22960683703422546, 0.0979207381606102, 0.2051071226596...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#delegate
Delegate To store the version data based on a threshold in either the default storage location or a fallback storage location use DelegateVersionStorageAdapter service. If the size of metadata or binary data information exceeds the configured byteThreshold value, the version data is stored using the fallback adapter. Pimcore\Model\Version\Adapter\VersionStorageAdapterInterface: public: true alias: Pimcore\Model\Version\Adapter\DelegateVersionStorageAdapter Pimcore\Model\Version\Adapter\DelegateVersionStorageAdapter: public: true arguments: $byteThreshold: 1000000 $defaultAdapter: '@Pimcore\Model\Version\Adapter\DatabaseVersionStorageAdapter' $fallbackAdapter: '@Pimcore\Model\Version\Adapter\FileSystemVersionStorageAdapter' Pimcore\Model\Version\Adapter\FileSystemVersionStorageAdapter: ~ Pimcore\Model\Version\Adapter\DatabaseVersionStorageAdapter: arguments: $databaseConnection: '@doctrine.dbal.versioning_connection' In this example the version data is stored in the database as long as neither the metadata nor the binary data exceeds 1000000 bytes in size. Otherwise, the filesystem is used as storage.
Delegate
[ -0.3579044044017792, 0.04286804422736168, -0.1155344769358635, 0.0636759027838707, -0.20545999705791473, -0.1781577169895172, -0.3821723163127899, 0.28227105736732483, -0.4272294044494629, 0.2702745199203491, 0.18462026119232178, 0.14723961055278778, -0.027191899716854095, 0.08163118362426...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#turn-off-versioning-for-the-current-process
Turn off Versioning for the Current Process Sometimes it is very useful to just deactivate versioning for a process. For example for importers or synchronization with 3rd party systems. You can globally deactivate and activate the versioning with the following PHP code directly in your scripts: \Pimcore\Model\Version::disable(); // to disable versioning for the current process \Pimcore\Model\Version::enable(); // to enable versioning for the current process Note: With these commands you only deactivate/activate the versioning for the current PHP process. This setting is not saved, and only affects changes on elements which are modified within this process!
Turn off Versioning for the Current Process
[ -0.5466921925544739, -0.24599917232990265, -0.20639970898628235, -0.19070018827915192, 0.015642696991562843, -0.37264981865882874, 0.1559925526380539, 0.4609057903289795, -0.06540674716234207, 0.47736597061157227, 0.06620726734399796, 0.24825315177440643, 0.03366430476307869, 0.08444347977...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#working-with-php-api
Working with PHP API When working with PHP API - especially when saving elements - you need to set the userModification so that a proper user is shown in version history. When you set userModification to 0 Pimcore shows system as user in the version history. $object->setUserModification(0); $object->save();
Working with PHP API
[ -0.3656103312969208, 0.22139573097229004, -0.12594129145145416, 0.08692343533039093, 0.021985303610563278, -0.4750860631465912, 0.27184927463531494, -0.018673166632652283, -0.26225510239601135, 0.3337867259979248, 0.056246668100357056, 0.2277764081954956, 0.034432921558618546, 0.0072063957...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Versioning#example:-how-to-get-a-previous-version-of-an-object
Example: How to get a previous version of an object $versions = $currentObject->getVersions(); $previousVersion = $versions[count($versions)-2]; $previousObject = $previousVersion->getData();
Example: How to get a previous version of an object
[ -0.35740184783935547, -0.33388662338256836, -0.23429499566555023, 0.23468519747257233, -0.39338457584381104, -0.11624155938625336, -0.1453760713338852, 0.2440209686756134, -0.028671137988567352, 0.37990084290504456, 0.3310422897338867, -0.2642025947570801, -0.09138310700654984, -0.18002270...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Auto_Save_Drafts#auto-save-drafts
Auto Save Drafts Pimcore has an auto save functionality enabled by default for Data Objects and Documents, which creates a draft on default interval of 60 seconds or as soon as there is a first change detected on a data object/document. This feature creates a draft version, which is not published and changes will appear only in backend until published. It is possible to change interval or completely turn off auto save functionality(by setting interval to 0) in config.yaml: pimcore: documents: auto_save_interval: 60 # saving interval in seconds, default 60s, set to 0 to disable it objects: auto_save_interval: 60 # saving interval in seconds, default 60s, set to 0 to disable it Note: When using Auto Save for a type, the "Disable unsaved content warning" checkbox in User profile will have no effect on the close action.
Auto Save Drafts
[ -0.33024540543556213, -0.03793501853942871, 0.002971422392874956, -0.2413986772298813, -0.05587087944149971, -0.3367353081703186, 0.21595744788646698, 0.09460633248090744, -0.19885443150997162, 0.2850300669670105, 0.007134443148970604, 0.3334139287471771, 0.11330101639032364, 0.19769152998...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Custom_Icons#custom-icons-&-tooltips-for-documentsassets-&-data-objects
Custom Icons & Tooltips for Documents/Assets & Data Objects Pimcore allows to dynamically define custom element icons & tooltips in the element tree. In addition, the icon of the editor tab can be changed.
Custom Icons & Tooltips for Documents/Assets & Data Objects
[ -0.16080838441848755, -0.1942792534828186, -0.24593335390090942, 0.09814850240945816, 0.004938088357448578, -0.1859935224056244, 0.16754035651683807, 0.1719321757555008, -0.09831096231937408, 0.15874038636684418, -0.1684308648109436, 0.6386929750442505, -0.02272866666316986, 0.364510416984...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Custom_Icons#properties-that-can-be-changed
Properties that can be changed Element CSS class Element icon Element icon class Tree node tooltip
Properties that can be changed
[ -0.016328124329447746, -0.3616088032722473, -0.4045424461364746, 0.20260483026504517, 0.3156522810459137, -0.15566302835941315, 0.0967092365026474, -0.030437298119068146, -0.11586637049913406, 0.18623751401901245, -0.05371992662549019, 0.2230609953403473, 0.1175193041563034, 0.109869197010...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Custom_Icons#how-to-override-the-default-style
How to override the default style The basic idea is to provide one's own implementation of Pimcore\Model\Element\AdminStyle. This can be achieved by attaching a listener to the AdminEvents::RESOLVE_ELEMENT_ADMIN_STYLE event. Example: In config/services.yaml add App\EventListener\AdminStyleListener: tags: - { name: kernel.event_listener, event: pimcore.admin.resolve.elementAdminStyle, method: onResolveElementAdminStyle } Create AdminStyleListener in EventListeners <?php namespace App\EventListener; class AdminStyleListener { public function onResolveElementAdminStyle(\Pimcore\Bundle\AdminBundle\Event\ElementAdminStyleEvent $event): void { $element = $event->getElement(); // decide which default styles you want to override if ($element instanceof \App\Model\Product\Car) { $event->setAdminStyle(new \App\Model\Product\AdminStyle\Car($element)); } } }
How to override the default style
[ -0.2342730015516281, -0.3137833774089813, -0.1129290759563446, -0.07501009106636047, 0.23075906932353973, -0.3046524226665497, 0.25040364265441895, 0.14760567247867584, -0.11475338786840439, 0.31449803709983826, 0.0663682296872139, 0.3099725544452667, -0.08792393654584885, 0.29075694084167...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Custom_Icons#example:-custom-icon-for-the-car-dataobject
Example: Custom Icon for the Car DataObject This will change the Car icon depending on the car type: namespace App\Model\Product\AdminStyle; use Pimcore\Model\DataObject; use Pimcore\Model\Element\AdminStyle; class Car extends AdminStyle { protected ElementInterface $element; public function __construct(ElementInterface $element) { parent::__construct($element); $this->element = $element; if ($element instanceof \App\Model\Product\Car) { DataObject\Service::useInheritedValues(true, function () use ($element) { if ($element->getObjectType() == 'actual-car') { $this->elementIcon = '/bundles/pimcoreadmin/img/twemoji/1f697.svg'; } }); } } } Result:
Example: Custom Icon for the Car DataObject
[ -0.2643854320049286, -0.13726560771465302, -0.19948361814022064, 0.46137723326683044, 0.08751878142356873, -0.2985680401325226, 0.29736971855163574, 0.06524913012981415, -0.12249208986759186, 0.26038679480552673, -0.024643056094646454, 0.4716317057609558, -0.15158505737781525, 0.2654768526...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Custom_Icons#example:-custom-tooltips
Example: Custom Tooltips It is possible to define custom tooltips which are shown while hovering over the element tree. The example outlines how to provide a custom tooltip for Car objects. /** * {@inheritdoc} */ public function getElementQtipConfig(): ?array { if ($this->element instanceof \App\Model\Product\Car) { $element = $this->element; return DataObject\Service::useInheritedValues(true, function () use ($element) { $text = '<h1>' . $element->getName() . '</h1>'; $mainImage = $element->getMainImage(); if ($mainImage) { $thumbnail = $mainImage->getThumbnail("content"); $text .= '<p><img src="' . $thumbnail . '" width="150" height="150"/></p>'; } $text .= wordwrap($this->element->getDescription(), 50, "<br>"); return [ "title" => "ID: " . $element->getId() . " - Year: " . $element->getProductionYear(), "text" => $text, ]; }); } return parent::getElementQtipConfig(); } Result:
Example: Custom Tooltips
[ -0.25069257616996765, -0.2631239593029022, -0.24047258496284485, 0.28456974029541016, -0.04922783374786377, -0.23177045583724976, 0.09274046868085861, 0.24730397760868073, 0.17186780273914337, 0.20986583828926086, 0.1492157131433487, 0.31178635358810425, -0.24648483097553253, -0.0876627936...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Custom_Icons#example:-custom-style-for-assets
Example: Custom Style for Assets This will display the modification date and image size as additional information. Besides that, it shows a different icon for all assets starting with a capital 'C' in their key. namespace App\Model\Product\AdminStyle; use Pimcore\Model\Asset; use Pimcore\Model\Element\AdminStyle; class AssetEventStyle extends AdminStyle { public function __construct(ElementInterface $element) { parent::__construct($element); if ($element instanceof Asset\Image) { if (strpos($element->getKey(), 'C') === 0) { $this->elementIconClass = null; $this->elementIcon = '/bundles/pimcoreadmin/img/twemoji/1f61c.svg'; } $this->elementQtipConfig = [ 'title' => 'ID: ' . $element->getId(), 'text' => 'Path: ' . $element->getFullPath() . '<br>Modified: ' . date('c', $element->getModificationDate()) . '<br>Size: '. $element->getWidth() . 'x' . $element->getHeight() . " px" ]; } } }
Example: Custom Style for Assets
[ -0.2936786711215973, -0.16141603887081146, -0.3147912919521332, 0.302793949842453, -0.0887722447514534, -0.14127607643604279, 0.17220941185951233, 0.3503778278827667, -0.25259721279144287, 0.13600489497184753, -0.08687181770801544, 0.4489345848560333, -0.09966157376766205, 0.10672181844711...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Scheduling#scheduling
Scheduling
Scheduling
[ -0.19490770995616913, -0.23974302411079407, -0.3715236485004425, 0.1677694171667099, -0.006522799376398325, -0.25982773303985596, -0.03150599077343941, -0.159561425447464, -0.22797535359859467, 0.1889284998178482, 0.40162232518196106, 0.12393095344305038, -0.18452750146389008, 0.1713488399...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Scheduling#general
General Every element type in Pimcore (documents, objects, assets) has implemented a scheduler which provides the ability to create tasks like: Publish Unpublish Delete Publish version - Publish a specific version (You can read more about Versions in the Versioning section) Important: If object is already published, then using Publish option will not publish latest version(unpublished) so it is recommended to use Publish version option in that case. Note: To use scheduler you have to configure "cronjobs". You can find more in the System setup section.
General
[ -0.17145098745822906, -0.029656628146767616, -0.12286338210105896, -0.32046830654144287, -0.3618035614490509, -0.267784982919693, 0.08022095263004303, -0.022877417504787445, -0.21923956274986267, 0.31844696402549744, 0.07899733632802963, 0.5601519346237183, -0.07565691322088242, 0.30668887...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Scheduling#usage
Usage Let's use objects as an example. In the Pimcore backend UI find the icon: You can add a task by clicking on the Add button, which will add an empty row. It has some configurable options: date, time and action (which should run with that task). The version option will only be used if you chose the "Publish version" action. The active checkbox will indicates that the task was not finished yet. To make a task that automatically publishes an unpublished object just fill the values like in the picture, below: The effect in the database will be: `schedule_tasks` # id, cid, ctype, date, action, version, active '7', '76', 'object', '1474034700', 'publish', NULL, '1' When the ./bin/console pimcore:maintenance -j scheduledtasks script will finish processing jobs you could see the changes. In the edit object view: In the database: `schedule_tasks` # id, cid, ctype, date, action, version, active '8', '76', 'object', '1474034700', 'publish', NULL, '0'
Usage
[ -0.05564257502555847, -0.015192173421382904, -0.10167975723743439, -0.23495569825172424, -0.35793036222457886, -0.4333497881889343, -0.06778481602668762, -0.14406771957874298, -0.14320935308933258, 0.4713606536388397, 0.2863932251930237, 0.6933444738388062, -0.040237072855234146, 0.2757368...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#notes-&-events
Notes & Events
Notes & Events
[ -0.2185356616973877, -0.3546466827392578, -0.30528879165649414, 0.4955572187900543, -0.11072570085525513, -0.026550378650426865, -0.15165750682353973, 0.084112249314785, -0.18334230780601501, 0.28396132588386536, 0.21603178977966309, -0.016007648780941963, -0.26729950308799744, -0.06768838...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#general
General Notes & Events are primarily used to log changes or events on elements independently from the versioning. This includes changes made by marketers, editors, automated importers / synchronisations, .... Simply everything that has nothing to do with the data itself but is important to know.
General
[ 0.04147558659315109, -0.310404509305954, -0.09880570322275162, 0.197230726480484, -0.05956687033176422, 0.21577094495296478, -0.15247170627117157, 0.17004793882369995, 0.013168178498744965, 0.13371309638023376, 0.2948152720928192, -0.049737293273210526, 0.03157927840948105, 0.2151241898536...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#use-cases
Use cases An importer (CLI-script) that adds information to objects which changes were made Marketers / SEOs adding information which changes were made on documents like "optimized for keyword xyz ..." There are really nearly endless possibilities what to do with Notes & Events.
Use cases
[ 0.024297108873724937, 0.08076861500740051, -0.20680515468120575, -0.10631250590085983, -0.28230395913124084, -0.2510254681110382, 0.14370059967041016, 0.21502719819545746, -0.042841508984565735, 0.21975091099739075, 0.36077359318733215, 0.23036672174930573, -0.01932487264275551, 0.29642996...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#create-notes-&-events
Create Notes & Events
Create Notes & Events
[ -0.344544380903244, -0.30671751499176025, -0.275664746761322, 0.30711135268211365, -0.08218695968389511, -0.047864705324172974, -0.11263507604598999, 0.149278461933136, -0.046132177114486694, 0.25166118144989014, 0.16947782039642334, 0.04399483650922775, -0.29632189869880676, 0.18573142588...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#using-api
Using API use Pimcore\Model; $object = Model\DataObject::getById(4); $note = new Model\Element\Note(); $note->setElement($object); $note->setDate(time()); $note->setType("erp_import"); $note->setTitle("changed availabilities to xyz"); $note->setUser(0); // you can add as much additional data to notes & events as you want $note->addData("myText", "text", "Some Text"); $note->addData("myObject", "object", Model\DataObject::getById(7)); $note->addData("myDocument", "document", Model\Document::getById(18)); $note->addData("myAsset", "asset", Model\Asset::getById(20)); $note->save(); And this is how the entry looks like: Note: As the title of a note is translatable (admin domain) make sure you don't add variable text that would lead to unintended translation entries. Use the description or data for details instead.
Using API
[ -0.19378496706485748, 0.024268541485071182, -0.20067450404167175, 0.2738807499408722, 0.18663270771503448, -0.2562912106513977, -0.013775952160358429, -0.03736140578985214, -0.0867418646812439, 0.2718452513217926, 0.024636706337332726, 0.4496763348579407, -0.07598450779914856, 0.1727618724...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#add-events-in-pimcore-backend-ui
Add Events in Pimcore backend UI You could also add the note directly in the edit view of objects, documents and assets.
Add Events in Pimcore backend UI
[ -0.2877683639526367, -0.011155294254422188, -0.18619680404663086, -0.15554994344711304, -0.126471146941185, -0.3051047623157501, -0.06975199282169342, -0.0663294792175293, -0.15966194868087769, 0.3535638153553009, 0.12559692561626434, 0.4760707914829254, 0.01903853379189968, 0.170434743165...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Notes_and_Events#specify-custom-types-for-notes-and-events
Specify Custom Types for Notes and Events Via Pimcore configuration, the selectable types for notes and events can be specified per content type (asset, document, data object), see sample config below: # config/config.yaml or any other Symfony config file pimcore_admin: documents: notes_events: types: - "" - "content" - "seo" - "some other type" assets: notes_events: types: - "" - "content" - "licese renewal" - "some other type" objects: notes_events: types: - "" - "manual data change" - "some other type"
Specify Custom Types for Notes and Events
[ -0.2956352233886719, 0.016281608492136, -0.07008666545152664, 0.2897145748138428, 0.04078065976500511, -0.30185556411743164, -0.01683327741920948, 0.23641382157802582, -0.2811676561832428, 0.1196039691567421, -0.30278921127319336, 0.47062498331069946, 0.05556608736515045, -0.03815532475709...
https://pimcore.com/docs/platform//Pimcore/Tools_and_Features/Properties#properties
Properties
Properties
[ -0.26097366213798523, -0.33237943053245544, -0.36162400245666504, -0.04993477463722229, 0.03128301352262497, -0.023606907576322556, 0.23656663298606873, 0.272124707698822, -0.059711866080760956, 0.3315541744232178, -0.1595155894756317, 0.09286997467279434, -0.058243852108716965, -0.0908760...