Forum Discussion

peterlu's avatar
peterlu
Champion
8 years ago

17.9 breaks many sites - ${coreNode.nodeType}

Hi Lithium,

 

I think 17.9 changed the behaviour of the coreNode built-in object, the below API always returns "board" even if you are in blog, contest and other type of boards.

ChhamaJ SuzieH

 

Any ideas?

Sites with customisations are now broken.

 

Peter

 

nodeTypeReturns the type of the core node, such as community, category, board, blog, and so on. 
 ${coreNode.nodeType}
  • Oops, it really not working on pages. But SuzieH it's a good idea to get the board type using coreNode.conversationStyle object as we are getting it in console screen but can not use it on a page. Please have a look on it. 

    Anyway peterlu , You can use the ${page.interactionStyle} to get the type of board.  If you are on a board it would return blog, forum, idea, TKB etc based on their conversation style.  On other pages, it may return None,  for other pages you can use coreNode.nodeType.  

    <#assign nodeType = coreNode.nodeType /> 
    <#if coreNode.nodeType == 'board'> <#assign nodeType = page.interactionStyle /> </#if>

     

4 Replies

  • We arent on 17.9 yet but will need to keep an eye on this as we make extensive use of the API.

  • peterlu allensmith81  Do not worry about it. Everything is fine this as it was the same behavior on the previous versions as well. Nodetype would always return the 'board' either it is forum or blog. But you can differentiate it using conversationStyle. See screenshot here

    ${coreNode.conversationStyle} 
  • peterlu's avatar
    peterlu
    Champion
    8 years ago

    VikasBthanks for the info. I believe coreNode.conversationStyle is not covered in Lithium Doc :) In previous versions, coreNode.nodeType does return different value, eg. "blog", "idea" etc
    SuzieHLithium Doc needs update :) Thanks

     

    ------

    VikasB I just tried ${coreNode.conversationStyle}  ,  it throws a freemarker error?

     

     

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Oops, it really not working on pages. But SuzieH it's a good idea to get the board type using coreNode.conversationStyle object as we are getting it in console screen but can not use it on a page. Please have a look on it. 

    Anyway peterlu , You can use the ${page.interactionStyle} to get the type of board.  If you are on a board it would return blog, forum, idea, TKB etc based on their conversation style.  On other pages, it may return None,  for other pages you can use coreNode.nodeType.  

    <#assign nodeType = coreNode.nodeType /> 
    <#if coreNode.nodeType == 'board'> <#assign nodeType = page.interactionStyle /> </#if>