Fórumok

Fetch all pages from each Communities

Nakkeeran R, módosítva 15 év-val korábban

Fetch all pages from each Communities

New Member Bejegyzések: 5 Csatlakozás dátuma: 2008.10.11. Legújabb bejegyzések
Hi,

I need to display the all pages under each community using navigation.vm file.

Currently i'm able to get only the count of each communities public and private pages.

I have to display the all pages under public and private in a tree structure.

PFA for my current navigation menu's snapshot.

Help me in this regard.

Thanks,

Nakkeeran R
l b, módosítva 14 év-val korábban

RE: Fetch all pages from each Communities

New Member Bejegyzések: 9 Csatlakozás dátuma: 2009.08.04. Legújabb bejegyzések
up
Antonio Martínez, módosítva 14 év-val korábban

RE: Fetch all pages from each Communities

Junior Member Bejegyzések: 32 Csatlakozás dátuma: 2009.01.14. Legújabb bejegyzések
I need the same.

Thanks.
thumbnail
Amos Fong, módosítva 14 év-val korábban

RE: Fetch all pages from each Communities

Liferay Legend Bejegyzések: 2047 Csatlakozás dátuma: 2008.10.07. Legújabb bejegyzések
Do you need all pages of the current community? Or do you need all pages of EVERY community?

This is how the classic theme does it for it looks like 3 levels of layouts for the current community.

		#foreach ($nav_item in $nav_items)
			#if ($nav_item.isSelected())
				#set ($nav_item_class = "selected")
			#else
				#set ($nav_item_class = "")
			#end

			<li class="$nav_item_class">
				<a href="$nav_item.getURL()" $nav_item.gettarget()><span>$nav_item.getName()</span></a>

				#if ($nav_item.hasChildren())
					<ul class="child-menu">
						#foreach ($nav_child in $nav_item.getChildren())
							#if ($nav_child.isSelected())
								#set ($nav_child_class = "selected")
							#else
								#set ($nav_child_class = "")
							#end

							<li class="$nav_child_class">
								<a href="$nav_child.getURL()" $nav_child.gettarget()>$nav_child.getName()</a>
							</li>
						#end
					</ul>
				#end
			</li>
		#end
Antonio Martínez, módosítva 14 év-val korábban

RE: Fetch all pages from each Communities

Junior Member Bejegyzések: 32 Csatlakozás dátuma: 2009.01.14. Legújabb bejegyzések
Hi Amos,

I need the pages of the user community. I want to show a list of his pages to the user when he is at guest community.

Thanks.
thumbnail
Amos Fong, módosítva 14 év-val korábban

RE: Fetch all pages from each Communities

Liferay Legend Bejegyzések: 2047 Csatlakozás dátuma: 2008.10.07. Legújabb bejegyzések
Antonio,

This is probably the easiest way to get it:

LayoutLocalService.getLayouts(groupId, privateLayout);


You can get the groupId like this:

$user.getGroup().getGroupId()


See this wiki for help using services if you need it:
https://www.liferay.com/community/wiki/-/wiki/Main/Access+to+Liferay+services+in+Velocity