eZ Community » Blogs » Damien Pobel » Planet eZ Publish.fr orbited by eZ...

By

Planet eZ Publish.fr orbited by eZ Publish 5!

Thursday 13 December 2012 12:03:28 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

(For french speaking people, the original french version of this article is available on my own blog)

As announced on Twitter and Google+ a week ago, the Planet eZ Publish.fr (the french version of Planet eZ Publish.org) is now powered by eZ Publish 5 (actually, it's build from git clones from 2012-12-04 so it's a version somewhere between 5.0 and the future 2012.11/2012.12 versions). 

As far as I know, it's the first eZ Publish 5 based website online and it does not only use the legacy fallback mechanism. I tried to re-implement it as much as possible in the Symfony 2 stack. The source is code is available on github in the repository dpobel/planet-ezpublish.fr. The most interesting elements can be found in the PlanetBundle, and in the configuration files ezpublish.yml, override.yml and parameters.yml.

New stack vs. legacy

At the moment, there are only 3 legacy based features left:

  • The contact form because the collectible fields are not fully implemented
  • The search engine is still based on eZ Find because the Solr integration is a bit light
  • A cleanup script but only because I'm lazy :-)

All the rest uses the new APIs and the Twig template engine:

Bugs and miscellaneous impediments

Unsurprisingly, there are a few bugs in the new version; the opposite in a .0 version would have been very surprising, but there are also more general missing feature.

The public API is very verbose. I wrote a gist to compare the code to retrieve a node list sorted by priority in both old and new APIs. I think it's self explained! For my project, I wrote some convenient methods to avoid repeating myself again and again. It's probably not the best way of doing this but at least this is working.

The eZ Publish 5 templates are really different from the eZ Publish 4.x ones. It's not only a language change. The most important point is the removal of our good old template fetch functions. It's a great thing in terms of technical architecture but at the moment this adds a bit of complexity while writing content view templates because it's very rare to only need the current location and content to generate the view output. In such case, a solution is to call a custom controller action in a sub-request (for instance the full view of home page). An other solution might be to use the ezpublish.pre_content_view event. Your event listener will be called for all views so you have to detect the execution context and it's not that easy (see for instance PlanetBundle/EventListener/PreContentViewListener.php). For me, there's a room for an improvement to make the injection of custom parameters easier in view templates.

As a former eZ Publish integrator, I hope we'll find some time to improve those areas of the product.

Performances

What about performances ? The right word is probably "contrasted"! Indeed, on a website without authentication and with very few content changes, it's quite easy to maximize the HTTP cache usage and then get the performances of the Symfony 2 reverse proxy. In this case, eZ Publish 5 is better than eZ Publish 4.x serving a fully cached and optimized page (cache-block + viewcache)! If the Symfony 2 reverse proxy is too slow, it's possible to use a dedicated reverse, and here Varnish is probably the best choice.

However, if some parts of the page need to be recalculated, the performances decrease very quickly. This is one of the current hot topic, so I guess some improvements will be soon there.

Conclusion

IT WORKS! To be honest, it's even better than what I was personally expected some months ago! Obviously, there are bugs and features that need to be improved but still eZ Publish 5 is usable in many use cases and for the rest, the legacy fallback is available at different levels.

So now, can I haz my badge "I run an eZ Publish 5 based website" ? ;-)

Proudly Developed with from