Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Achmed Tyrannus Albab
Velocity CMS: Trying to get link name.
23. Oktober 2012 21:18
Antwort

Achmed Tyrannus Albab

Rang: Regular Member

Nachrichten: 118

Eintrittsdatum: 5. März 2010

Neue Beiträge

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.
Anonym
RE: Velocity CMS: Trying to get link name.
23. Oktober 2012 21:39
Antwort

Anonym

check out this bug. LPS-30492
parikshit sharma
RE: Velocity CMS: Trying to get link name.
23. Oktober 2012 22:16
Antwort

parikshit sharma

Rang: Junior Member

Nachrichten: 50

Eintrittsdatum: 18. Oktober 2012

Neue Beiträge

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.
23. Oktober 2012 23:35
Antwort

Achmed Tyrannus Albab

Rang: Regular Member

Nachrichten: 118

Eintrittsdatum: 5. März 2010

Neue Beiträge

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.