How do I get Sites of which the user is a member in Liferay theme?

痞子三分冷 提交于 2019-12-04 20:03:30

From the user object you can retrieve the groups he belongs to:

$user.mySites

This returns a List<Group>. Once you have the Group you can easily build a URL to the public and private pages of this group:

<ul>
    #foreach($site in $user.mySites)
        #if ($site.hasPrivateLayouts())
            <li><a href="/group${site.friendlyURL}">$site.descriptiveName</a></li>
        #end
        #if ($site.hasPublicLayouts())
            <li><a href="/web${site.friendlyURL}">$site.descriptiveName</a></li>
        #end
    #end
</ul>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!