The Top 5 usefull fast Query for Sitecore CMS.

Here are some (fast) queries that I use and that helps me to create new queries.

1. All items where Workflow state is in  "draft" or "waiting for approval".
Sure you need to replace the GUIDs and startpaths by yours!

/sitecore/content/Home//*[(@@templateid='{7D54D520-DA7E-41FE-B186-60D768F8CBBD}' OR @@templateid='{EFCF4776-F0E5-430A-947F-EA8885078D93}' OR @@templateid='{BBCC95B1-CABD-424E-B279-6E28833730A8}' ) AND (@#__Workflow state#='{A8FCE6CD-E744-4873-A126-BED31AE2E870}' OR @#__Workflow state#='{0847018D-C0B4-442C-82BA-6904BAFBD796}')]


2. Get all data templates where fallback is NOT enabled.
fast:/sitecore/templates/User Defined//*[@@templatename='Template field' AND @enablefallbackifconfigured != '1']



3. All images with dash in item name
/sitecore/media library/Images//*[contains(@@name, '-')]



4. Get all item that are tagged with an specific tag. ( custom taxonomy our Fild name "Related Tags" amd multilist field)

/sitecore/content/Home/Resources/Contacts/*[(contains(@#Related Tags#, '{3F6A06E2-EC9E-47E6-A9F5-E2EB859F0306}') or contains(@#Related Tags#, '{8421946D-D897-42C6-9356-5AC9C1C10848}') or contains(@#Related Tags#, '{257D4302-711E-4AB3-8D56-124DA1BFB325}')) and (contains(@#Related Tags#, '{7EB18485-E083-46E9-92E4-EBD698E198AB}') or contains(@#Related Tags#, '{B8259500-C87A-4607-AB56-344D01EBC178}'))]


5. Images with empty alt field
/sitecore/media library/Images//*[(@@templateid != '{FE5DD826-48C6-436D-B87A-7C4210C7413B}' OR @@templateid != '{79581AC3-0A55-4444-B92F-01671C191482}') AND @alt = '']


Do you have more useful queries? Feel free to add them.

Happy coding.

Comments