Since few days ago, sillonbol.com site is powered by eZ Publish 5. In fact, it’s powered with clones of the master versions from the eZ Publish Community Edition and the eZ Publish Legacy versions and its core is updated regularly to get new functionalities accepted by the eZ crew.

What you see in the page is the result of a migrating from a site fully powered by the eZ Legacy Stack to a site powered by the Symfony part at (i would say) 80%. It’s also the result of a redesign of the site.

What we had

Our site was quite basic. It was just a root node with a bunch of folders (called “subcategoria” in our case) with childrens inside. Those children can be objects of two classes, but those two classes were identical and were rendered by the same template. It had also a frontpage powered by eZ Flow, a tags system powered by the eZ Tags extension, a search form and results page powered by eZ Find, a comments system powered by eZ Disqus and finally a Contact Form. Finally, it also had a custom extension where all the customization of the look and feel happened.

We keep this version of the site still accessible just to be linked from this article and to show how the site powered by symfony stack and  the site powered by the legacy one can live together. Actually, both installations are sharing database and var folders.

What we wanted.

Apart from moving to eZ 5, we thought we needed a redesign of the site. Our previous site has no mobile version and was no responsive, and our (few) readers asked us about it. We’re no designers, and so we googled searching for something that could fit our new ideas. And thats were this Fullby theme appeared. It’s a wordpress one, but i thought it could be easily ported to the Symfony stack. Finally, some friends helped us with the colours.

The result

 

With these ideas in mind, i started with the development of a bundle. It’s heavily based on the eZ Demo one, so you can take this eZ Demo one as a really good starting point if you plan a new eZ 5 site or the migration of a eZ 4 one. This bundle has been published to github. Feel free to fork and contribute if you want :).

Actually, the site is even more basic than it was. As we don’t produce many pieces of content content, we decided to avoid the ez flow part. Apart from that, we maintain the more important functionalities of the previous site and here is what i’ve done for it.

Layout.

Css, js and images provided by the chosen theme were added to the bundle. Then, the main layout was built. This twig template has a condition for showing our main block just in the case we are in the home page (location 2). Some includes and controllers take care of the rest.

Folders and Article pages

I created some twig templates for them. They are quite basic. Article pages just render the fields, while listing pages uses PagerFanta for the pagination stuff. Both use a custom controller. In the articles case, this controller is used in allviewtypes. And i can make use of one of all of the variables added in one or another template.

Tags fields in articles are rendered thanks to the Netgens – TagsBundle. I just added a custom template to override how the tags are presented in the bundle and to add a link to a list of articles tagged with each tag.

As said above, articles had comments powered by ezdisqus extension. That extension added a datatype to the legacy code. But in the ez5 part, there is no need to keep that datatype. Instead, commentsBundle is used. But as we didn’t want any database modification in the migration, i just mapped that field to the null converter.

Finally, i added a bit of xslt to have custom online editor tags working. And to tell eZ to look for this xslt, a setting in the bundle config file is enough.

 

Tags and Search Pages

Listing of content tagged with a tag or search result module is still ran by the legacy system. (well, the search result pages needs some polish…). One of the greatness of eZ 5 is that even if lots of eZ 4 functionalities haven’t been ported to the symfony stack yet, they are still usable and without any configuration. The work here was just modify the legacy templates to adapt them to our new look and feel. Anyway, and thanks to the possibility of running legacy code, my next step will be create dedicated symfony controllers for this matter and use twig templates for the presentation part.

Contact Page

Even we used the famous information collection fields in our previous install, we rarely looked at them as we also received the inquiries by email. So, i decided go for symfony here. I truly believe form creation is an easier task in eZ 5 than in eZ 4 thanks to the Symfony Form Component.

As in the eZ 4 version our contact form was found in “contacto”, i just added a new route and a new controller for rendering the form. Captcha functionality was easily added thanks to this great other bundle.New Blog entry: Migrating http://t.co/iBGTo1NC0h from eZ Publish 4 to eZ Publish 5 @crevillo revillohttp://ow.ly/tAkaL #ezpublish