Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-756

New notation for replacing null values with a specified string

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Engine
    • None

    Description

      If I have a variable $foo and it is null, I have the option of using the silent notation $!foo for not writing it. But often when genrating HTML pages I want to express that the values is missing, e.g. by a "-". That means that I have to write my code like this:

      #if($foo)
      $foo
      #else
      -
      #end

      Wouldn't it be great if there were a new option like $?foo (or whatever chararter would be suitable instead of "?") that would print the variable $foo if it was not null and otherwise print a predefined character like "-".

      /Ludwig

      Attachments

        Activity

          People

            Unassigned Unassigned
            theludd Ludwig Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: