11

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).

11

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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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