Forum Discussion

Quelyn's avatar
Quelyn
Genius
10 years ago
Solved

Question on freemarker for board specific header

http://community.lithium.com/t5/Developers-Knowledge-Base/Using-a-FreeMarker-Page-Initialization-Script/ta-p/125767

 

In this KB they reference the "page.name" call.  I am trying to make a header specific to a certain board, so not just "forumpage".  I tried to look around in documentation, but I couldn't find anything. 

 

Do you guys know what I can use?  I tried "board.name" and that did not work.  Any help would be greatly appreciated! 

 

 

4 Replies

  • There is no call like board.name, for board specific, you can use coreNode.id which will return the id of current board.

    i hope this helps.
  • Quelyn's avatar
    Quelyn
    Genius
    10 years ago

    Hmm, I have seen some stuff referencing the coreNode.id.  But how would I use it in this context, do you know? 

     

    <#if user.anonymous && page.name == "CommunityPage">  ${http.response.setRedirectUrl(webuisupport.urls.page.name.get("custom-anonymous-user-landing-page").build())}
    <#elseif !user.anonymous && page.name == "custom-anonymous-user-landing-page">
    ${http.response.setRedirectUrl(community.urls.frontPage)}
    </#if>

    Would I change it to this:

    <#if user.anonymous && page.name == "CommunityPage">  ${http.response.setRedirectUrl(webuisupport.urls.page.name.get("custom-anonymous-user-landing-page").build())}
    <#elseif !user.anonymous && coreNode.id == "<what goes here>">
    ${http.response.setRedirectUrl(community.urls.frontPage)}
    </#if>

     

    I'm pretty noobish here, so sorry if I'm missing something.

  • The board ID will go as the parameter, which is after bd-p/(board-id)