if (item.Versions.GetLatestVersion(language).Versions.Count >0) { // you have a version } else { // you don't }The thing to note here is that "GetLatestVersion" will return you an item, even if it doesn't have a version in the specified language, but the count of versions on that item will be 0.
Tuesday, 19 March 2013
Does my Sitecore Item Have a Version in a Specific Language
So, this post is pretty heavily related to my last one "How to get Language Specific Links from Sitecore" and comes from the fact that even if you haven't created a version of your item in a specific language it will act as though it does. The quick snippet for this one is:
Subscribe to:
Post Comments (Atom)
How to disable "Add Users" in Sitecore's Platform DXP
I have seen a few posts going around the community asking how to disable the "Add Users" button in Sitecore Platform DXP. This ...
-
Lately I have been doing some work with Sitecore 7 and I had a requirement to work with the webforms rendering engine(as opposed to the MVC ...
-
This week I had the opportunity to attend both the Sitecore Partner Summit and Trendspot down here in Sydney. Off the back of attending I th...
-
So I was working through an issue with a customer recently and we couldn't work out why a certain behavior was happening and why it appe...
No comments:
Post a Comment