Results 1 to 8 of 8

Thread: html.ftl problem if condition

  1. #1
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default html.ftl problem if condition

    i have a html.ftl page where i can see several #if condition, here is an example:

    Code:
    <#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

  2. #2
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    i don't know, hi you're right, what is it?
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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?

  4. #4
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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:
    Code:
    <!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...

  5. #5
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ok, i have the answer for ??

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

  6. #6
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    and the code is freemarker

    Last edited by NDK; 02-12-2009 at 02:22 PM. Reason: added link

  7. #7
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    Code:
    <#if c.properties["present"]??>
    represents that if the property "present" stores any value the code inside this condition will be executed.

  8. #8
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •