Forum Discussion
Trying this and getting an error:
Freemarker template 'ContentWrapper' parsing failed:
ParseException:Parsing error in template "ContentWrapper" in line 102, column 18: Unknown directive: #elseif. Help (latest version): http://freemarker.org/docs/ref_directive_alphaidx.html; you're using FreeMarker 2.3.20.
I'll try variations on this... Definitely seems closer. The elseif in the middle needs to be "else", but that still doens't work. Back to the drawing board :)
Quelyn correct ... bothe elseif should be else ... I just wrote the code like that to show the logic ... it might be full of errors!
- OlivierS10 years agoLithium Alumni (Retired)
Quelyn I thin k the apporach is not the best here ... you should build your menu based on the role(s) the user have ...
First, you set up a 'menu' string:
<#assign my_li=''>
Then you build your menu string depending on the role(s):
if user has role admin then my_li += '<li>admin link</li>'
if user has role employees then my_li += '<li>employee link</li>'
Sorry, it's just the theory, not hte actual freemarker code ... but that's a much better approach I think ...
- Quelyn10 years agoGenius
OlivierS Well, I *thought* that's what I was doing! But the problem comes into play because the way we are setup some users have more than one role. And that's when things don't really work.
But we define all the roles, and we say, "If someone is Employee, they see this menu", and "If someone is Support they see this OTHER menu". But the people who are support have both the Employee and Support roles, for access to KB / Forums.
So, that's the use case that is having the problem.
Ideally we would like a menu that is dynamic like the "Community Browser" but customizable.
Related Content
- 8 months ago
- 3 months ago
- 7 months ago