Hi,
How can I apply global:page.content() and global:paragraph.content when using xslt templates?
I am trying to apply it to the page templates, but since there is no presence of that in the XML...
Best Regards,
Nuno
Developer forum
E-mail notifications
Global:Page/Paragraph.Content()
Posted on 21/10/2009 13:15:37
Replies
Nicolai Høeg Pedersen
Posted on 21/10/2009 13:20:51
Simply input the template tag in the XSLT template. Not as XSLT template tag, but good old <!-- tag - it should work.
Posted on 21/10/2009 14:00:02
Hi Nicolai,
Unfortunately it does not work. The tag renders null. Any other ideas?
Best Regards,
Nuno
Unfortunately it does not work. The tag renders null. Any other ideas?
Best Regards,
Nuno
Posted on 22/10/2009 10:15:09
Hi Guys
You should actually do like this.
1. Have a template in you XSLT file looking like this:
<xsl:template name="globalpararaph">
<xsl:param name="paragraphid" />
<xsl:comment>
<xsl:value-of select="concat('@Global:Paragraph.Content(', $paragraphid, ')')" />
</xsl:comment>
</xsl:template>
2. And then call it like this:
<xsl:call-template name="globalpararaph">
<xsl:with-param name="paragraphid" select="'2691'" />
</xsl:call-template>
And I have moved this thread to the XSLT category ...
// Dammark
You should actually do like this.
1. Have a template in you XSLT file looking like this:
<xsl:template name="globalpararaph">
<xsl:param name="paragraphid" />
<xsl:comment>
<xsl:value-of select="concat('@Global:Paragraph.Content(', $paragraphid, ')')" />
</xsl:comment>
</xsl:template>
2. And then call it like this:
<xsl:call-template name="globalpararaph">
<xsl:with-param name="paragraphid" select="'2691'" />
</xsl:call-template>
And I have moved this thread to the XSLT category ...
// Dammark
Posted on 22/10/2009 20:21:16
Hi Sebastian,
Thanks a lot. Works like a charm.
Sorry about the wrong category. Will keep more alert next time.
Best Regards,
Nuno
Thanks a lot. Works like a charm.
Sorry about the wrong category. Will keep more alert next time.
Best Regards,
Nuno
Posted on 22/01/2010 15:40:13
Hi,
Apparently local url/links used on the included paragraph arent transformed to a SEO-friendly version when using the above kind of include!?
Any tricks or solutions to this?
/Morten
Apparently local url/links used on the included paragraph arent transformed to a SEO-friendly version when using the above kind of include!?
Any tricks or solutions to this?
/Morten
Nicolai Høeg Pedersen
Posted on 22/01/2010 15:49:53
Look in this thread - there you will find a custom hack...
http://engage.dynamicweb-cms.com/Forum-5.aspx?action=ShowThread&ThreadID=1644
I have it on my todo to fix it in Dynamicweb...
http://engage.dynamicweb-cms.com/Forum-5.aspx?action=ShowThread&ThreadID=1644
I have it on my todo to fix it in Dynamicweb...
Posted on 25/01/2010 10:23:43
Nicolai,
Any chance of getting the hack in C#?
I tried to convert it using http://www.developerfusion.com/tools/convert/vb-to-csharp/ but with no luck :(
FYI: Im using the Default.aspx/.cs that came with the custom modules.
/Morten
Any chance of getting the hack in C#?
I tried to convert it using http://www.developerfusion.com/tools/convert/vb-to-csharp/ but with no luck :(
FYI: Im using the Default.aspx/.cs that came with the custom modules.
/Morten
Antonio Amézquita Ganoza
Posted on 30/01/2012 11:12:37
Hej Sebastian
The code works great, do you know how to include a translate tag into the mix?
to achieve something like this:
<!--@Global:Paragraph.Content(<!--@Translate(globalParagraph, "60")-->)-->
The code works great, do you know how to include a translate tag into the mix?
to achieve something like this:
<!--@Global:Paragraph.Content(<!--@Translate(globalParagraph, "60")-->)-->
Nicolai Høeg Pedersen
Posted on 30/01/2012 11:21:29
I do not think that is possible...
Antonio Amézquita Ganoza
Posted on 30/01/2012 11:31:35
I think I found a solution to me own question., here is what I came with :
thank you much anyway.
<!--Global:Paragraph.Content + translate in XSLT-->
<xsl:template name="translateglobalpararaph">
<xsl:param name="translationkey"/>
<xsl:param name="defaulttranslation"/>
<xsl:variable name="currentlanguage" select="/Template/GlobalTags/Global.Area.LongLang"/>
<!-- Loading translations -->
<xsl:variable name="translation" select="$translate/translations/key[@name=$translationkey]/translation[@culture=$currentlanguage]"/>
<xsl:choose>
<xsl:when test="string-length($translation) != 0">
<xsl:comment>
<xsl:value-of select="concat('@Global:Paragraph.Content(', $translation, ')')" />
</xsl:comment>
</xsl:when>
<xsl:otherwise>
<xsl:comment>
<xsl:value-of select="concat('@Global:Paragraph.Content(', $defaulttranslation, ')')" />
</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and then calling the template like this:
<xsl:call-template name="translateglobalpararaph">
and then calling the template like this:
<xsl:call-template name="translateglobalpararaph">
<xsl:with-param name="translationkey" select="'translateglobalpararaph'" />
<xsl:with-param name="defaulttranslation" select="'9956'" />
</xsl:call-template>
thank you much anyway.
You must be logged in to post in the forum