09 December, 2011

Get community list in theme

If you want to fetch all the community list in theme after login,
you can use below code :


#set ($myPlaces = $user.getMyPlaces())
                <div class="community-names" style="float:left;background: #73B3DE;width:100%;padding: 5px 0 5px 5px;">
                #foreach ($myPlace IN $myPlaces)
                  #if ($myPlace.isCommunity()) 
                   #set ($commurl = "http://localhost:8080/web$myPlace.getFriendlyURL()/home")
                  
                    <a  href="$commurl">
                        $myPlace.getName()
                    </a>
                    #end
                #end
                </div>

Enjoy !!!!

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...