Forum Discussion

Suchith's avatar
6 years ago

Component labels.widget.labels-list not displayed on Category Page

Hi,

I am trying to use labels.widget.labels-list component on category, but I was unable to see label component. Later I found that we can able to use labels.widget.labels-list component only on "Blog, Contest, Forum, Q&A and TKB conversational article".

Please let me know is there a way to add Label component to Category page.

Thanks,

 

  • Suchith the default component cannot do that afaik, although it can be solved with a custom component as there is an API call to get labels for a category, try something like:

    /restapi/v1/categories/id/<category.id>/labels

    and then render the HTML yourself (you can even copy the structure/classes etc. from the original or even better, @override it so you can actually use the default component for both use cases, e.g. use the default <@delegate> as long as coreNode.nodeType == 'board'

    • Hi luk ,

      We are planning to make changes on the current UI of the Label component. To do this do I need to create custom component or will it be possible to make changes on the existing components.

      I am also creating a custom Label component. I am following the below approach. Please let me know if i need to add any other points.

      1: Check if the existing page is board or TKB.
      2. Get the id of the page
      3. execute the rest call to get the label names.
      4. create web filter url for all the labels  
      5. add all these attribute to the element which you want to display.

      Thanks,