Contao 2.9.x to 2.10.x Upgrade Issues

Posted by Howard Richardson (comments: 0)

In many ways the 2.10 line of Contao requires some quite substantial site restructuring and rewriting to use all its new features, but many people just want to do the live update and keep their 2.9 sites running as before without taking advantage of new 2.10 features such as the HTML 5 templates or browser detection.

A common problem encountered after running the live update is to be confronted with a single error message "No pages found" or else to have reams of warning messages telling you that the template extension is depreciated. The instructions below explain the steps needed to fix this and get your site running again under 2.10, just like it was before the live update.

  • Do the live update
  • If you don't already have a "website root" page in your site structure, make one. Tick “language fallback”. Make the page name the name of the site. Fill in admin email and XML sitemap details (if you want one). You can leave other fields blank if you want. Tick publish and save and close.
    Now with all the branches of your site structure tree collapsed so only the top level and the new site root are showing, use “edit multiple” to move all pages into the new website root, ie. use "paste into" not "paste below".
  • Go into the filesystem and rename all files in the site's templates directory which end in “.tpl” to end in“.xhtml” instead.
  • In all templates called “fe_page[...]” change the line:
     <?php echo $this->robots; ?> 
    to:
    <meta name="robots" content="<?php echo $this->robots; ?>" />
  • I've also found that in some older templates for events listings, $this->link needs to be changed to $this->href
  • One further change you'll need if you find that none of your articles are displaying is to go into your mod_articles template and change <?php echo $this->contentElements; ?> to the newer form <?php echo implode($this->elements); ?>   
  • The insert tag "env::website_title" is deprecated. Change any instances to "page::rootTitle" instead.
  • Test site to see if everything is working properly!

Go back

Add a comment