Has anyone managed to get the locale ID for the context of an instance of a Content Query Web Part in XSL, without extending the class?

DataViewWebParts have a Language parameter passed in, but CQWP doesn't have this.

Even if there's a way to pass in the LCID via the CommonViewFields somehow would make it accessable in the XSL...

(This is all for MOSS).

link|improve this question

feedback

1 Answer

up vote 8 down vote accepted

You can use ParameterBindings to this purpose.

<ParameterBinding Name="Language" Location="Resource(wss,language_value)" />

This will return "en-us" for English locale in xsl:param "Language". Also, you can pass whole resource values this way.

You can read more about this in Stefan Stanev's blog:

http://stefan-stanev-sharepoint-blog.blogspot.com/2010/09/xsltlistviewwebpart-contentbyquerywebpa.html

link|improve this answer
Excellent, this is exactly what I was after. Cheers! – James Love Apr 8 '11 at 17:34
This is great, however I can't find the Language_value key on the wss resource file, did you do it manually ? thanks – Renzo Apr 14 '11 at 12:16
no, it's ootb in my C:\inetpub\wwwroot\wss\VirtualDirectories\80\App_GlobalResources\wss.resx file. – Andrey Markeev Apr 14 '11 at 19:51
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.