Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-375

ifEmpty is not working properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 2.1 Final
    • None
    • None
    • None

    Description

      from an email:

      i noticed some strange things with the core cms tags "ifNotEmpty" and "ifEmpty"...

      i have a content element 'textTitle', which has content set. so it's not empty (at least to my understanding )

      i have following test code:
      nodeData 'textTitle' = <cms:out nodeDataName="textTitle" />

      <cms:ifNotEmpty nodeDataName="textTitle" >
      <br><cms:out nodeDataName="textTitle" /> --> from 'if not empty'
      </cms:ifNotEmpty>

      <cms:ifEmpty nodeDataName="textTitle" >
      <br><cms:out nodeDataName="textTitle" /> --> from 'if empty'
      </cms:ifEmpty>

      the surprising result:
      nodeData 'textTitle' = A line of Text
      A line of Text --> from 'if empty'

      i expect that i should get "A line of Text --> from 'if NOT empty'

      why that? i am not using a collection or so. simply a "top level" content element.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              fgiust Fabrizio Giustina
              pbaerfuss Philipp Bärfuss
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD