Forum Discussion

adriana4u's avatar
4 years ago

Help, I can't make signposting

Hello,

 

Hope to find you well.

 

The past weeks I've been reading and testing the signposting in our stage community and last week I finally started working on the component. Yesterday, with help of support, I tried to put it in our wrapper but it keeps giving a sort of "error" (as you can see in attachment). And, not only that, but it appears in the community landing page when it should only appear in the ID of the category I put. 

This is what I put on the component with help of support: 

<#assign public =""/>
<if(coreNode.hasAncestor{"category"}) == true || (coreNode.id) == "UBW" || ... >
<span class="public_logo_link" title="This content is publicly available"> Public </span>
</if>

I've been really trying to put the signposting working correctly. Do you have any tips? 

 

2 Replies

  • MattV's avatar
    MattV
    Khoros Staff
    4 years ago

    You have some errors in your code. Partially corrected code below.

     

    <#if coreNode.hasAncestor("category") == true || coreNode.id == "UBW">
    <span class="public_logo_link" title="This content is publicly available"> Public </span>
    <#/if>

     

    Freemarker tags need to start with the "<#" characters, so a freemarker if-statement is "<#if" followed by a space, then your conditionals. 

    Your coreNode.hasAncestor() was using curly braces instead of parenthesis. Then "category" needs to be the category id, such as "UBW".

    Then finally properly closing the freemarker if-statement.

    Hope this helps.

  • TedV's avatar
    TedV
    Khoros Alumni (Retired)
    4 years ago

    Hi adriana4u,

     

    If the response answered your question, do you mind marking it as an accepted solution, please?

     

    Thanks!