Download the PHP package basilicom/pimcore-path-formatter-bundle without Composer
On this page you can find all versions of the php package basilicom/pimcore-path-formatter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download basilicom/pimcore-path-formatter-bundle
More information about basilicom/pimcore-path-formatter-bundle
Files in basilicom/pimcore-path-formatter-bundle
Package pimcore-path-formatter-bundle
Short Description This bundle provides path formatter pattern configuration for Pimcore DataObjects in multi-relation.
License GPL-3.0-or-later
Homepage https://basilicom.de
Informations about the package pimcore-path-formatter-bundle
Basilicom Extended Path Formatter Bundle for Pimcore
Usecase / Summary
If you want to display specific informations of a dataObject when it's listed in a relation-field, you can use this
plugin to easily configure a display-pattern.
Without creating a new PathFormatter in your project to displaying the name, price and currency of a product-class you
can just configure it like:
Or you might want to define a specific pattern for a product in the relation-field of a specific class.
While the product will be formatted like Sneakers 19.99EUR
in all relation-fields with the formatter, the
ProductList-Class will show them in like #13 - Sneakers
Version information
Bundle Version | PHP | Pimcore |
---|---|---|
^1.0 | ^7.3 | ^6.0 |
^2.0 | ^8.0 | ^10.0 |
^3.0 | ^8.1 | ^11.0 |
Installation
Install the bundle using composer require basilicom/pimcore-path-formatter-bundle
Execute bin/console pimcore:bundle:enable BasilicomPathFormatterBundle
or
add the following lines to AppKernel::registerBundlesToCollection()
(recommended)
Configuration
- Add the
basilicom_path_formatter
key to your Pimcoreapp/config/config.yml
-
Configure a pattern by adding the full qualified dataObject class-name as key the pattern-string as value.
Use class-property-names, accessible by public getter methods, surrounded by curly brackets.
This also enables you to reference basic PimcoreConcrete
/AbstractObject
methods like:fullPath
for\Pimcore\Model\DataObject\AbstractObject::getFullPath())
className
for\Pimcore\Model\DataObject\AbstractObject::getClassName())
- ...
Example:
Note: If no getter exists for the property, the placeholder will stay untouched.
- Add
@Basilicom\PathFormatterBundle\DependencyInjection\BasilicomPathFormatter
to the Formatter-Field in the relation-fieldType.
Note: The@
is important, as the formatter is registered as a service, including dependency injection.
Advanced configuration
Contextual pattern overwrites
It is possible to configure a context-based pattern, so that a dataObject in a relation-field of a specific class will be formatted differently.
Example:
While the product will be formatted like Sneakers 19.99EUR
in all relation-fields, the ProductList-Class will show
them like #13 - Sneakers
or #13 - Sneakers (premium-only!)
, based on the product class.
Formatting documents and assets
Additional features
Toggle inherited values in DataObjects
Inherited values from DataObjects will be used by default. In order to avoid this, just disable the configuration:
Showing images
As soon as you reference a property in the pattern, which is a Pimcore\ModelAsset\Image
, it will be rendered as
small preview in the relation-list.
This feature can be disabled by setting the value of enable_asset_preview
to false
.
Author: Alexander Heidrich (Basilicom GmbH)
License: GPL v3