Development with Pimcore

I was looking for a system to easily combine Digital Assets Management (DAM), CMS, E-commerce and Product Information Management (PIM). Multiple articles suggested systems like WordPress but I felt like I'd like to have something more suitable for hardcore PHP programmers. Finally, I found Pimcore. Never heard of it? Well, I tried it out and here are some observations after learning Pimcore for 2 months.

In a few words: it works, and could be fun when building a simple website, but also could bring about some not-so-obvious moments. Let's break it down!

Sounds serious, doesn't it? To put it simply, Pimcore is a development-ready framework with an admin panel out of the box + highly configurable capabilities as eCommerce.

Why Pimcore?

Current version of Pimcore is based on Symfony 3.4 so you could enjoy the benefits from both ends: Symfony bundles + Pimcore-oriented bundles.

Pimcore has a rich admin panel which allows you to manage documents, data objects, translations, logs, e-mails, users and their roles, assets, plus some more settings.

It is a huge relief for the developer − you still have Symfony under the hood, but no need for additional configuration time for the content management bundles, like EasyAdmin and others.

Documents are the CMS part of Pimcore and are the way to go for managing unstructured contents using pages, content snippets and navigation. It looks like the web interface for the controller actions. What you do is:

set a template

provide controller action, which could expose some variables into that template

adjust the custom route to it

Other settings like SEO-related or even more advanced (e.g. notes, custom properties, or even schedule for publishing) are included.

One of the other great benefits here is using Editables − a rich set of widgets which can be plugged inside Document to improve content management with WYSIWYG and drag-n-drop controls. With the skeleton package of Pimcore, there are no such things as lightboxes, carousels or slideshows, so those should be implemented by the developer (however some examples of it can be found inside the demo-projects available).

Pimcore has also Users and Roles management, which liberates you from the necessity to configure it within the framework by handle.

Translations is another good part. It gives you the ability to translate content within templates using Symfony/Twig helpers as usual, and also manage it with the admin panel (no more *.po files). Some tricky movements will be made with controllers and routes though, but after some struggling, I'd say it is totally possible to implement a multi-language site with Pimcore, and to handle a l10n/i18n anywhere within a project.

The big part of the framework ecosystem is eCommerce. It gives you a highly configurable e-shop (when it comes to all Pimcore based solutions), but I have no experience with it, honestly.

Development experience

Pimcore is not something easy to start with if you were familiar only with WordPress or another CMS. It is more of a framework than a CMS, so it may need some time to start comfortable development.

Pimcore has a nice documentation, but sometimes it lacks details. Based on my experience, such important parts as testing and deployment are not highlighted enough. Even a habitual migration process doesn't work as expected, since the project has some non-exporting data elements from DB logical data chunks.

Framework has its own idea of ORM and doesn't use Entities like Symfony, but autogenerated models − and some things don't work as expected. At first it was a bit confusing to use this approach but honestly: it integrates easily.

You've got some Classes autogenerated from GUI administration instead of Entities. In that case Pimcore creates special wrappers on it, and you get some models instead of repositories.

The great part of it − even native elements, such as Documents or email, are similar to custom Data Objects API, which makes development easier while working with CRUD operations.

Under the hood it is still Symfony, so a lot of cool things are available − dependency injections, routing, tools for logging, profiler; it supports both PhpEngine and Twig templating.

One of the most complicated parts was a multilingual website building. There are some differences between Documents (like a static "About Company" page) and custom Data Objects (like the "entity" Article), which any developer should be aware of. If the structure becomes complex, it can cause headache − like in case you create a Document consisting of a few Snippets, and all of that stuff should handle the current language on several levels of inclusion.

A bit harder than WordPress theming ;)

Another issue I can spot there is not a fully comfortable way to create a dynamic route with the UI admin. For example, you could configure a feed of articles, even use URI placeholders (slugs) which will land into controller action parameters. But you cannot create an article viewer with a dynamic ID in the route − it is obviously dynamic, so the preview in the admin panel fails trying to display it with an attached template. Hardcoding a default ID is not an option, so I had to implement it as a usual Symfony controller action with Route and Template annotations. It works but seems magic as it is outside the scope observable by an admin user.

Last but not least, there are Tests. Fortunately, they work like a charm. Pimcore uses Codeception testing framework, which is supplied by default. It makes it possible to write the unit, functional and acceptance tests. The difference between the two latter is in that the fact acceptance tests have no clue about framework internals but could traverse and interact with the HTML source by habitual CSS-selectors − with or without Selenium.

Unit tests have the same syntax as the usual PHPUnit tests, so the migration from clear PHPUnit-based tests into codeception ones took a zero latency.

Conclusion

Pimcore saves a lot of time by utilizing some boring parts like user management or editable forms. It can really speed up development for an experienced developer, so take a moment and check the related info − it might become your next project.