Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Achmed Tyrannus Albab
Velocity CMS: Trying to get link name.
October 23, 2012 9:18 PM
Answer

Achmed Tyrannus Albab

Rank: Regular Member

Posts: 118

Join Date: March 5, 2010

Recent Posts

Hi,
I made a simple (well supposedly) navigation using Structure and Template.
How i approach is by these codes below:

 1<?xml version="1.0"?>
 2
 3<root>
 4    <dynamic-element name="link" type="link_to_layout" index-type="" repeatable="true">
 5        <dynamic-element name="colors" type="list" index-type="" repeatable="false">
 6            <dynamic-element name=" pink " type="pink" index-type="" repeatable="false"></dynamic-element>
 7            <dynamic-element name=" orange " type="orange" index-type="" repeatable="false"></dynamic-element>
 8            <dynamic-element name=" yellow " type="yellow" index-type="" repeatable="false"/>
 9        </dynamic-element>
10    </dynamic-element>       
11</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:
1    #foreach ($menu in $menuurl.getSiblings())
2        #set($menulinks = $menu.getData().replaceAll("&", "&").replaceAll("&", "&"))
3        #set($menuUrl = $menu.getType().getName().replaceAll("&", "&").replaceAll("&", "&"))
4...and many more which i didnt keep...
5          #end
6        $menuUrl


Sample, i have page Home,Shops,Hotels.
I want these names instead of 1 , 2 or 3.
Get what i mean?

Thanks.
Anonymous
RE: Velocity CMS: Trying to get link name.
October 23, 2012 9:39 PM
Answer

Anonymous

check out this bug. LPS-30492
parikshit sharma
RE: Velocity CMS: Trying to get link name.
October 23, 2012 10:16 PM
Answer

parikshit sharma

Rank: Junior Member

Posts: 50

Join Date: October 18, 2012

Recent Posts

These 1,2,3 are the layoutIds to get the friendlyURL use the below code
1
2#set($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
3#set($layout=$layoutLocalService.getLayout($groupId,$layoutId))
4$layout.friendlyURL
Achmed Tyrannus Albab
RE: Velocity CMS: Trying to get link name.
October 23, 2012 11:35 PM
Answer

Achmed Tyrannus Albab

Rank: Regular Member

Posts: 118

Join Date: March 5, 2010

Recent Posts

John Carter:
These 1,2,3 are the layoutIds to get the friendlyURL use the below code
1
2#set($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
3#set($layout=$layoutLocalService.getLayout($groupId,$layoutId))
4$layout.friendlyURL


These to be applied in the CMS Templates?
Nothing seems to return. Liferay 6.1.