Jahia in English > Display categories...

0 (0 Good)
0 (0 Bad)

Display categories elements of the list

by  mholmberg »  2013/05/31 13:29

Hello,

 

I have a list of persons that each of them belong to some categories. I want to display on the list beside other informations also the categories the person belongs to. I am strugling to find a way to do this but I can not find out how to make it possible.

 

thanks

  • Display categories elements of the list
    2013/05/31 13:29

    mholmberg <p> Hello,</p> <p> &nbsp;</p> <p> I have a list of persons that each of them belong to some categories. I want to display on the list beside other informations also the categories the person belongs to. I am strugling to find a way to do this but I can not find out how to make it possible.</p> <p> &nbsp;</p> <p> thanks</p>

  • Number of messages  22
    Registration date May 31, 2013
    0 (0 Good)
    0 (0 Bad)

    Re: Display categories elements of the list

    by  faissah »  2013/05/31 22:09

    Hello,

    I imagine that your list displays a list view of the persons. In order to display the category, you need to create a new view for person where you display the category as well.

    You can retrieve the categories of a node using the syntax:

    <jcr:nodeProperty node="${currentNode}" name="j:defaultCategory" var="assignedCategories"/>

    And then display the categories using something like this:

        <c:forEach items="${assignedCategories}" var="category" varStatus="status">
            <c:if test="${not empty category.node}">
                <p>${category.node.properties['jcr:title'].string}</p>
            </c:if>
        </c:forEach>

    Fabrice  (faissah)

    Number of messages  264
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Display categories elements of the list

    by  mholmberg »  2013/06/03 08:44

    Thank you so much, it works perfectly. I have been looking everywhere but could not find any reference of it; where would you suggest me to get documented? Jahia document section lacks a lot of these infos in my opinion.

     

  • Re: Re: Display categories elements of the list
    2013/06/03 08:44

    mholmberg <p> Thank you so much, it works perfectly. I have been looking everywhere but could not find any reference of it; where would you suggest me to get documented? Jahia document section lacks a lot of these infos in my opinion.</p> <p> &nbsp;</p>

  • Number of messages  22
    Registration date Jun 3, 2013
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page