Adding custom object datatypes


#1

Hi everyone,

I am stuck with creating a custom datatype. According to the documentation on pimcore (https://pimcore.com/docs/5.x/Development_Documentation/Extending_Pimcore/Bundle_Developers_Guide/Adding_Object_Datatypes.html) I will essentially have 3 files:

  • custom.php for managing the data stored for this data type
  • custom.js for the class definition editor
  • custom.js for the object editor (object tag)

after modifying the config.yml located in ‘apps/pimcore/htdocs/app/config/config.yml’ and extending the required configuration, the data type is not showing up in the pimcore admin UI. Is there a step I am missing here?

I have tried using the existing wysiwyg object datatype and refactored some of the code as a test to create my own custom one: https://github.com/maerrco/PimcoreTestDataComponent
I’m unsure where I’m going wrong here.


#2

Hi,
just to be sure :wink: - did you clear the symfony cache and rebuild the container?

BR
Christian


#3

It’s a basic example how I implemented a new data type, probably it’ll help you (especially the initialize function):

After that I’ll execute the following commands
php bin/console assets:install --symlink —relative
php bin/console cache:clear
php bin/console pimcore:cache:clear


#4

so far it looks good to me. But: did you include the js files in your bundle for pimcore to load them?


#5

hi,
did you find a solutions for your Problem? i have the same problem

thank you