wpigoury
12 years agoMentor
Getting current label within a component
Hi,
Is there a way to get the current label from within a component?
I mean another way than to parse the url and retrieve the label-name value from it.
There should be something in the request parameter or attributes but I can't put my finger on it.
I created a little component listing the labels used in my Ideas section in tabs and when I clicked on a label I would like to highlight the corresponding tab and to keep it highlighted as long as I browse ideas with this label.
Thanks.
I'd suggest checking out the webuisupport context object. There are a couple methods that help you deal with path parameters:
You should be able to do something like:
<#assign label = webuisupport.path.parameters.name.get ("label-name","") /> <#if label?? && label?has_content> You chose label ${label.text} </#if>