Foren
Velocity CMS: Trying to get link name.
Achmed Tyrannus Albab, geändert vor 11 Jahren.
Velocity CMS: Trying to get link name.
Regular Member Beiträge: 158 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi,
I made a simple (well supposedly) navigation using Structure and Template.
How i approach is by these codes below:
All i'm trying to get is the link name in the Templates. Ive tried many things and the most i got is the friendly url which are numbers.
Please advice.
What i had tried:
Sample, i have page Home,Shops,Hotels.
I want these names instead of 1 , 2 or 3.
Get what i mean?
Thanks.
I made a simple (well supposedly) navigation using Structure and Template.
How i approach is by these codes below:
<!--?xml version="1.0"?-->
<root>
<dynamic-element name="link" type="link_to_layout" index-type="" repeatable="true">
<dynamic-element name="colors" type="list" index-type="" repeatable="false">
<dynamic-element name=" pink " type="pink" index-type="" repeatable="false"></dynamic-element>
<dynamic-element name=" orange " type="orange" index-type="" repeatable="false"></dynamic-element>
<dynamic-element name=" yellow " type="yellow" index-type="" repeatable="false" />
</dynamic-element>
</dynamic-element>
</root>
All i'm trying to get is the link name in the Templates. Ive tried many things and the most i got is the friendly url which are numbers.
Please advice.
What i had tried:
#foreach ($menu in $menuurl.getSiblings())
#set($menulinks = $menu.getData().replaceAll("&", "&").replaceAll("&", "&"))
#set($menuUrl = $menu.getType().getName().replaceAll("&", "&").replaceAll("&", "&"))
...and many more which i didnt keep...
#end
$menuUrl
Sample, i have page Home,Shops,Hotels.
I want these names instead of 1 , 2 or 3.
Get what i mean?
Thanks.
Bradley Wood, geändert vor 11 Jahren.
RE: Velocity CMS: Trying to get link name.
John Carter, geändert vor 11 Jahren.
RE: Velocity CMS: Trying to get link name.
Junior Member Beiträge: 53 Beitrittsdatum: 18.10.12 Neueste Beiträge
These 1,2,3 are the layoutIds to get the friendlyURL use the below code
#set($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
#set($layout=$layoutLocalService.getLayout($groupId,$layoutId))
$layout.friendlyURL
Achmed Tyrannus Albab, geändert vor 11 Jahren.
RE: Velocity CMS: Trying to get link name.
Regular Member Beiträge: 158 Beitrittsdatum: 05.03.10 Neueste BeiträgeJohn Carter:
These 1,2,3 are the layoutIds to get the friendlyURL use the below code#set($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService")) #set($layout=$layoutLocalService.getLayout($groupId,$layoutId)) $layout.friendlyURL
These to be applied in the CMS Templates?
Nothing seems to return. Liferay 6.1.