Results 1 to 3 of 3

Thread: Empty template sections are output

  1. #1
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Empty template sections are output

    Hi,

    i've just upgraded a site from Contao 2.9.4 to 2.11.3.

    All of the template sections are being output, even if they are empty. Doing a var_dump() on $this->left in my fe_page.html5 template (there is nothing in the left column) and I can see it's returning an empty string rather than false or null.

    Everything looks ok in my template and everything looks ok in the backend. I've disabled all of the extensions and still no luck.

    I'm running out of ideas, has anyone ever come across this?

    Cheers

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Empty template sections are output

    The behavior did change between those versions (I requested it). But the left column never returned null or false before, it returned instead when empty. I requested this to become nothing or an empty string because that makes much more sense.

    Perhaps you are using an extension or piece of code in your templates that still expects the ?

  3. #3
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: Empty template sections are output

    Thanks for the info, I always assumed it returned NULL or FALSE if there was no content.

    I'm actually using a template that I copied from a different 2.11.3 site. The template seems to work on that site which is why it seems strange it's producing different results with this site.

    The variables are tested with if($this->left), so perhaps I'll change this to check if it's an empty string or not instead.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •