Parsing order for field filters
Last: thread:238
Why not in simple pages
Edited: 11 Jan 2010 10:15 by: Steven Heynderickx
Comments: 4
Tags:
nav_last.png
Next: thread:278
Nested contexts / scopes
Edited: 05 Feb 2010 09:30 by: michal-frackowiak
Comments: 1
Tags:
nav_next.png

scottplanscottplan wrote on 18 Apr 2010 13:34

Text field filters

A filter takes the string value of a property and does something with it, producing a new string. We allow these filters on text fields:

  • |upper - converts value to upper case
  • |lower - converts value to lower case
  • |title - converts value to title case (first letter of each word is capitalized)
  • |nnn - truncates value to nnn characters
  • |?value - if the value is empty, substitutes with 'value'
  • |??truevalue:falsevalue - if property is non-zero or true, show trueval, else show falseval. Applies to all numeric and Boolean properties.
  • |url - format value as valid URL (e.g. replacing spaces by %20).

In my project's dataform, I'd like to inject :first if the user leaves an imgURL field empty, and %%author%% if they leave an email field empty. Would the |?value filter allow those items to be compiled, or would they result as uncompiled text?


Start a new sub-thread

Comments: 0

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License