Foros de discusión

Retrieving field labels for web content structures in ADT

Maarten J, modificado hace 9 años.

Retrieving field labels for web content structures in ADT

New Member Mensajes: 18 Fecha de incorporación: 25/01/12 Mensajes recientes
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).
#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, modificado hace 8 años.

RE: Retrieving field labels for web content structures in ADT

New Member Mensajes: 21 Fecha de incorporación: 9/06/15 Mensajes recientes
Hi,

Did you find a way? I need that as well emoticon