Forum Discussion

FranzG's avatar
FranzG
Genius
7 years ago

Resetting Top Level node to community level

I have a corner use case to allow our moderators the ability to view profile pages and other pages without a top level category being set for their session.  That way they can see if a user has jumped between different categories.

 

I've been able to use:

${nodes.top.setCategoryDisplayId("CATEGORY ID")}

described here: https://freemarker-docs-portal.lithium.com/refer/contextObjects#nodes

I have no problem using this to set a different top level node.  But I have been unable to find a way to completely remove the top level setting so that it switches to the community node.  I tried passing in the community id as the argument but no luck.  The only way to get it to do this is to clear all cookies and directly access a page that is not associated with a top level category like the View Profile page.

 

Question:  Is there a way to unset the Top Level category or is this not supported?

 

Any ideas?

 

 

Edit:  Also forgot to mention that when the community is set to the default node when I haven't visited a page within one of the top level categories, using nodes.top.categoryDisplayId returns the id for the community.  It just won't let me set it.

 

Also I know I could solve this with a custom component to load all the posts by API but I'm hoping to avoid that.  It makes sense that we should be able to unset the top level category if we can set it.

 

Thanks,

Franz

No RepliesBe the first to reply