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

Expose string property as booleans as well.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not an issue
    • Icon: Neutral Neutral
    • None
    • None
    • core, freemarker
    • None
    • Yes
    • Yes

      Since there are many places/cases where we store boolean properties as string properties in jcr (i.e a checkbox from a dialog), it's quite cumbersome to convert those in FreeMarker.

      Instead of what I'd expect to write:

          [#if content.myProperty]<p>Hello world</p>[/#if]
      

      one currently has to write something along these lines

          [#if content.myProperty!'false'=='true']<p>Hello world</p>[/#if]
      

      ... which is admittedly annoying, awkward and downright ugly.

      Here's a patch that shows we could expose strings as models of both strings and booleans to FreeMarker

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD