1
0
-1

Hi. Is it possible to retrieve the current active category from menu sidebar? 


I know there is a hash variable to retrieve the list count of the UI menu, as displayed below, but it is static value and also is not used for what I want, which is to retrieving the current active category.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      i think you can get it using js / jquery.

      looking at the html structure, the active menu item has the class "active" in it.


      you can try writing a simple js selector like "$($('#category-container').find('li.active').find('span')[0]).text();" to target and extract the menu text

      1. NAS

        Alright thanks! We still need to access it through js/jquery then to get the active category. I was hoping to just retrieve it from the platform, like how hash variable works, but for not seems like js and jquery is need.

      CommentAdd your comment...