Sitecore Query XPath for Finding all Fields with Field Fallback Disabled

Summary

The query below returns all fields on your templates that have the field Enable field level fallback disabled. This can be useful if you are creating a multi-lingual site and want to turn field fallback on for the fields on your data templates, but aren’t sure for which it’s already been done.

/sitecore/templates/User Defined//*[@@templatename='Template field' and @Enable Shared Language Fallback!='1']

How Does it Work?

Let’s break down the components of the query:

/sitecore/templates/User Defined//*[@@templatename='Template field' and @Enable Shared Language Fallback!='1']

Start at the root of the user-defined templates. This should be adjusted if you’re creating your templates elsewhere. (In a Habitat module, for example.)

/sitecore/templates/User Defined//*[@@templatename='Template field' and @Enable Shared Language Fallback!='1']

Look at all descendants (recursively check all children).

/sitecore/templates/User Defined//*[@@templatename='Template field' and @Enable Shared Language Fallback!='1']

Only return items of template Template field whose Enable Shared Language Fallback checkbox is not checked (this can include an empty value or 0).

** Note that the Item Name of the Enable Shared Language Fallback field is used here; the name of the field you see when editing a field in the content editor will be its title: Enable field level fallback.

Issues or suggestions? Let me know with a comment.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: