Hello All,
Discussion Topic
In my project we have requirement like, we have to display a localized string in Summary Link webpart. String like “See all”, since we have multilingual site we will require localized version of this string. So we decided to get string “See all” string from the resource file in XSLT.
So here we are going to discuss how to get the value from resource files in Summary Link webpart XSLTs.
Description
SummaryLink webpart is derived from DataFormWebPart webpart as:
Microsoft.SharePoint.WebPartPages.DataFormWebPart
Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart
Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart
There is <ParameterBindings> property of DataFormWebPart webpart. This property makes the resource strings available in XSLTs.
Syntax for <ParameterBindings> property in SummaryLinkWebPart definition file is as:
- <property name="ParameterBindings" type="string" >
- <ParameterBinding Name="testparameter" Location="Resource(resourcefilename,resourcestringwhosevalueneedtomakeavailable)" />
- </property>
Now here,
-
Location specifies the Resource function. SharePoint foundation uses Resource function to get the value of specified resource strings. You will get more details here.
-
Name is used in XSLT as parameter.
Now once you specified, in XSLT you will get this value as a parameter. I.e. in SummaryLinkMain.xsl file you will get the value from resource file by define it as follows:
- <xsl:param name=" testparameter" />
- <xsl:value-of select="$testparameter "/>
- <xsl:apply-templates select="." mode="itemstyle">
- <xsl:with-param name="teste1234" select="$tes123t"></xsl:with-param>
- </xsl:apply-templates>

Gowtham RajamanickamPosted Mar 12, 2015, 4:03 AM
good one...