Tag: Item Versions

Sitocore: Customizing the Core

Sitocore: Customizing the Core

Once you decided to build the site the following most known difficulties be present during site’s construction:

  • Complicated business logic.
  • Significant number of stakeholders.
  • Need to support several cultures (even you never heard about some of them)
  • Plenty of content

Fortunately, Sitecore solves (or at least gives convinient way) most of them. But you should keep in mind that Sitecore is not a magic pillis, but it’s more than up to the challenge when it comes to building sites.

Continue reading “Sitocore: Customizing the Core”


Sitecore: Search for Items That Don’t Have Any Language Versions Using Powershell

Recently, I have faced with an issue using traditional Powershell commands. I was trying to identify items that did not have any associated language version. There are various ways of how an item can get to this state. I will not get into these cases here, because they are typically specific to the implementation. But, what is certain across all cases is that these items cause problems because they (and their descendants) don’t get published. This causes a lot of confusion between what you see in Experience Editor and on the front-end site – items are not the same.

The problem lies in the format of traditional Powershell commands which are require a -Language param to retrieve specific versions. I specifically needed to identify unversioned items, but it was not so simply:

  • If you leave the language param off, it will use “en” as the default choice
  • If you pass an empty string for this param, it will return all versions of items that have language versions.

That’s great, but I still had not udentifier the items without a language version. If you want to reproduce it, just create a new item, then go to the “Versions” tab and delete the current version.

Here comes the Powershell

Since I could not use Get-ChildItems to get my unversioned items, I had the idea to look for items that have a collective count of all language versions equal to 0. There is a wonderful method  that helps me to achive my goal – GetVersions. It receives at the input bool includeAllLanguages and returns an array of items. This is the perfect method to leverage since I can test for an empty count to determine if it’s one of the unversioned items.

# point this to the root of your website
$folder = "/sitecore/content"

# Where-Object clause could be combined with other filters
# like Name or Template to narrow results for something specific
$items = Get-ChildItem -Path $folder -recurse | `
Where-Object { $_.Versions.GetVersions($true).Count -eq 0 } | `
"ID" = $_.ID
"ItemName" = $_.Name
"Item" = $_
"ItemPath" = $_.Paths.Path

# print out any results that were found

I hope this work around will save you some time and frustration. As I mentioned, being able to identify these items is critical to resolving the conflict between what you are seeing in the Experience Editor and what is showing on the front-end site.


Sitecore Content Editor: Performance Tips

Sitecore Content Editor: Performance Tips

While Sitecore continues to extend Content Editor functionality to the Experience Editor, Content Editor remains the interface of choice for developers and power users. Its performance can significantly impact the productivity of any development team. With the fairly simple adjustments I outline here, you can optimize Sitecore Content Editor performance and usability.

Continue reading “Sitecore Content Editor: Performance Tips”