Developer forum

Forum » Templates » Global:Page/Paragraph.Content()

Global:Page/Paragraph.Content()


Reply
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

Replies

 
Nicolai Høeg Pedersen
Reply

Simply input the template tag in the XSLT template. Not as XSLT template tag, but good old <!-- tag - it should work.

 
Reply
Hi Nicolai,

Unfortunately it does not work. The tag renders null. Any other ideas?

Best Regards,
Nuno
 
Reply
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
 
Reply
Hi Sebastian,

Thanks a lot. Works like a charm.

Sorry about the wrong category. Will keep more alert next time.

Best Regards,
Nuno
 
Reply
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
 
Nicolai Høeg Pedersen
Reply
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...
 
Reply
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

 
Antonio Amézquita Ganoza
Reply
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")-->)-->




 
Nicolai Høeg Pedersen
Reply
I do not think that is possible...
 
Antonio Amézquita Ganoza
Reply
 I think I found a solution to me own question., here is what I came with :

 <!--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">
            <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