Booleans on templates
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2010 05:46 AM
How can I reference the value of a boolean ?
<#if document.properties["custom
Rbols"]?exists>
It exists
</#if>
this returns if it exists, but i want to know if its set to true.
Related, how can I display Dates?
Thank you.
<#if document.properties["custom

It exists
</#if>
this returns if it exists, but i want to know if its set to true.
Related, how can I display Dates?
Thank you.
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2010 05:07 PM
Well, ?exists can only be true or false. Hence, it is true when "It exists" is displayed. If you need to assign a value based on the value, you could simply assign it inside the <#if>.
If you want to display a boolean value, I think you would use:
document.properties["custom
Rbols"]?boolean
As for dates:
document.properties["my:somefield"]?date
or
document.properties["my:somefield"]?datetime
will do
If you want to display a boolean value, I think you would use:
document.properties["custom

As for dates:
document.properties["my:somefield"]?date
or
document.properties["my:somefield"]?datetime
will do
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2010 05:48 AM
Bolseiro: ${document.properties["custom
Rbols"]?boolean}<BR>
I tried this, but whenever it is used the template view blanks out, breaking, I need to either test the boolean value or to at least show off what value it is placed at, true or false.
The date worked, thank you.

I tried this, but whenever it is used the template view blanks out, breaking, I need to either test the boolean value or to at least show off what value it is placed at, true or false.
The date worked, thank you.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2010 04:56 AM
Sorry for bumping this, but I could really use the help to display the boolean values?
Also, another detail, when displaying dates on templates, if they arent there, it screw up the display. ( as opposed to text, when if the value is not there it just appears as a blank)
Also, another detail, when displaying dates on templates, if they arent there, it screw up the display. ( as opposed to text, when if the value is not there it just appears as a blank)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2010 05:25 AM
http://wiki.alfresco.com/wiki/Alfresco_REST_Design_Guidelines#true_.2F_false_values
And for dates. For the bits of the REST API I have worked on we tend to format a string in the correct format and then put that into the model rather than trying to have freemarker format the date.
This may not be the best way, but it works :wink:
And for dates. For the bits of the REST API I have worked on we tend to format a string in the correct format and then put that into the model rather than trying to have freemarker format the date.
This may not be the best way, but it works :wink:
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2010 06:00 AM
If it's a boolean, just use ?string, which defaults to "true" and "false".
To also handle missing values, using something like:
The Freemarker documentation is a great resource for this stuff: http://freemarker.org/docs/index.html
Thanks,
Mike
To also handle missing values, using something like:
(document.properties["my:somefield"]!false)?string
The Freemarker documentation is a great resource for this stuff: http://freemarker.org/docs/index.html
Thanks,
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2010 07:21 AM
Thank you for your help, that was very useful, I wasnt aware of the name of the style of code used on templates so it had been harder to search for it.
