Adding Asset Types
This feature allows users to add their own custom asset types. To register new custom asset types, you must follow these steps:
1) Create the PHP asset class
The asset must extend
Pimcore\Model\Asset. Let´s create a class for InDesign (the namespace does not matter)
but it's best practice to put your assets into a
For examples have a look at the Pimcore core asset types at github.
class InDesign extends \Pimcore\Model\Asset
protected string $type = 'indesign';
It needs to extend
pimcore.asset.asset, be located in the namespace
pimcore.asset and named after the
$type property of the corresponding PHP class.
For examples have a look at the Pimcore core asset types at github
3) Register the asset on the asset type map
Next we need to update the
pimcore.assets.type_definitions.map configuration to include our asset. This can be done in any config
file which is loaded (e.g.
/config/config.yaml). The matching has to be an array of regular expressions of your data type.