Log in

View Full Version : html.ftl problem if condition



NDK
02-11-2009, 09:04 AM
i have a html.ftl page where i can see several #if condition, here is an example:


<#if c.isDocument && !c.parent.isDocument && c.properties["present"]??>

<#if !(c.properties["cm:creator"] != person.properties["cm:userName"] &&
c.properties["present1Type"]?? && c.properties["present1Type"]) + "Type"] == "ok")>

Does someone knows what the ?? means in the code? And which code-language is this?

tnx

smansakra
02-12-2009, 01:43 AM
i don't know, hi you're right, what is it?

bluewalrus
02-12-2009, 01:57 AM
what page did you get it from? Looks a bit like javascript. What does the code do can you put more in or a link to where it's being used?

NDK
02-12-2009, 08:36 AM
it's used for a DMS.

The code is used so we can generate a dashboard for the DMS.

so you have something like that:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
...
some javascript functions
...
</head>
<body>
...
<#if c.isDocument && !c.parent.isDocument && c.properties["present"]??>
<div>some HTML code</div>
</#if>
...
<#if !(c.properties["cm:creator"] != person.properties["cm:userName"] &&
c.properties["present1Type"]?? && c.properties["present1Type"]) + "Type"] == "ok")>
<div>some HTML code</div>
</#if>
...
</body>
</html>


I understand the conditions and the vars they use, but i don't know why they use ?? in the #if...

NDK
02-12-2009, 09:34 AM
ok, i have the answer for ??

apparently it's just to see if the var exist...

NDK
02-12-2009, 02:17 PM
and the code is freemarker (http://freemarker.sourceforge.net/)

http://freemarker.sourceforge.net/images/overview.png (http://freemarker.sourceforge.net/)

Guilherme_souza
06-27-2012, 01:56 PM
Hello, I think I now what it is...
You're editing Alfresco's ftl codes, right?
This code is in ftl language and I think that the expression

<#if c.properties["present"]??> represents that if the property "present" stores any value the code inside this condition will be executed.

keyboard
06-27-2012, 09:12 PM
This thread is very old and may have already been answered

Please don't bring up old threads like this without very good reason.
The original thread owner may not even see your reply, or they may have already fixed the problem