Foren
Retrieving field labels for web content structures in ADT
Maarten J, geändert vor 9 Jahren.
Retrieving field labels for web content structures in ADT
New Member Beiträge: 18 Beitrittsdatum: 25.01.12 Neueste Beiträge
In https://www.liferay.com/community/forums/-/message_boards/message/40807826 I answered my own question on how to retrieve localized values for custom webcontent structures in an ADT (Liferay 6.2).
The part which is missing imo is the retrieval of the label of these fields (localized). I can't find anywhere how to do this and imo this is not possible. Would be a big plus if that is possible.
#if (!$entries.isEmpty())
#foreach ($entry in $entries)
#set($renderer = $entry.getAssetRenderer() )
#set($className = $renderer.getClassName() )
#if( $className == "com.liferay.portlet.journal.model.JournalArticle" )
#set( $journalArticle = $renderer.getArticle() )
#set( $document = $saxReaderUtil.read($journalArticle.getContentByLocale($locale.toString())))
#set( $node = $document.selectSingleNode("/root/dynamic-element[@name='firstName']/dynamic-content"))
#set( $firstName = $node.getText() )
Firstname: $firstName
#set( $name = $document.selectSingleNode("/root/dynamic-element[@name='lastName']/dynamic-content"))
Lastname: $name.getText()
#end
#end
#end
The part which is missing imo is the retrieval of the label of these fields (localized). I can't find anywhere how to do this and imo this is not possible. Would be a big plus if that is possible.
Sabrina Toulouse, geändert vor 8 Jahren.
RE: Retrieving field labels for web content structures in ADT
New Member Beiträge: 21 Beitrittsdatum: 09.06.15 Neueste Beiträge
Hi,
Did you find a way? I need that as well
Did you find a way? I need that as well