Forums

Home » Liferay Portal » Italiano

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mauro Sartori
XSL e oggetti "Link to Page"
December 18, 2012 8:11 AM
Answer

Mauro Sartori

Rank: New Member

Posts: 7

Join Date: September 25, 2012

Recent Posts

Salve,

ho cercato tutto il forum per una risposta, ma non riesco a trovarla da nessuna parte ne in italiano ne in inglese.

Ho questa struttura XML :

<?xml version="1.0"?>

<root>
<dynamic-element name="Title" type="text" index-type="text" repeatable="false"/>
<dynamic-element name="Image" type="image" index-type="" repeatable="false"/>
<dynamic-element name="Testo" type="text_area" index-type="text" repeatable="false"/>
<dynamic-element name="Link" type="selection_break" index-type="" repeatable="true">
<dynamic-element name="Label" type="text" index-type="" repeatable="false"></dynamic-element>
<dynamic-element name="Link" type="link_to_layout" index-type="" repeatable="false"/>
</dynamic-element>
</root>

La parte in BOLD indica un link ad una pagina interna di Liferay. Il mio problema è come trasformare questo dato in un link reale alla pagina selezionata. Usando questa trasformazione :

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" indent="yes"/>
<xsl:template match="/root">
<div class="container_12 ntt-big-banner-container">
<div class="grid_12 ntt-template-row">
<div class="ntt-big-banner-subcontainer">
<img alt="">
<xsl:attribute name="src">
<xsl:value-of select="dynamic-element[@name='Image']/dynamic-content"/>
</xsl:attribute>
</img>
<div class="ntt-big-banner-overlay">
<h3 class="ntt-big-banner-title"><xsl:value-of select="dynamic-element[@name='Title']/dynamic-content"/></h3>
</div>
</div>
<p class="ntt-descriptive-paragraph">
<xsl:value-of select="dynamic-element[@name='Testo']/dynamic-content"/>
</p>
<div class="ntt-plus-bulleted-horiz-list">
<xsl:for-each select="dynamic-element[@name='Link']/dynamic-content">
<a>
<xsl:attribute name="href">
<xsl:value-of select="dynamic-element[@name='Link']/dynamic-content"/>
</xsl:attribute>
<span><xsl:value-of select="dynamic-element[@name='Label']/dynamic-content"/><span></span></span>
</a>
</xsl:for-each>
</div>
</div>
</div>

</xsl:template>
</xsl:stylesheet>

Ho come risultato per l'href del tat <a> il valore 2@public come posso avere invece un link reale ?

Grazie in anticipo per qualsiasi suggerimento

Mauro
Mauro Sartori
RE: XSL e oggetti "Link to Page"
December 31, 2012 7:19 AM
Answer

Mauro Sartori

Rank: New Member

Posts: 7

Join Date: September 25, 2012

Recent Posts

Nessuno conosce la risposta o può indicarmi un link o un libro dove trovare supporto per le trasformazioni XSL in Liferay ?

Grazie in anticipo

Mauro