Skip to main content

Questions tagged [sitecore-query]

For questions related to the syntax of and issues with Sitecore Query notation

Filter by
Sorted by
Tagged with
9 votes
1 answer
3k views

What are the limitations of Fast query?

After reviewing this question and answer you can see that the use of Fast query is the leading cause of migraines. (<- unverified claim) What are limitations a developer should take into account ...
Michael West's user avatar
  • 18.2k
9 votes
2 answers
9k views

Get all items where a certain template appears in its template inheritance

Is there a way to get all items where a certain template appears in its template inheritance? Say I want to get all items where /sitecore/Templates/Common/Sections/Search appears in that inheritance ...
themillennialdev's user avatar
9 votes
1 answer
5k views

Droplink source query breaks with templateid or templatename

I have a few fields in a template, and two of them have template name restrictions. Using the restriction, I get 0 results, and when removed I get all the items I want (plus others I don't) With ...
MStodd's user avatar
  • 284
8 votes
2 answers
14k views

Get all Children in the order defined in Sitecore

I have following structure in sitecore > Country > India > Srilanka > Bangladesh The following query returns all the child items but in alphabetical order string ...
rams's user avatar
  • 317
7 votes
2 answers
803 views

Is there a way to reference another database in Multilist with Search

I created a user content generated database in Sitecore where I will store my users and their comments. I plan to have a subscriptions item bucket that will be stored in the web database (published ...
Robert Michael Watson's user avatar
6 votes
4 answers
2k views

Sitecore Query fails - "::" expected at position 92

The below query fails and throws exception. /sitecore/content/Abcdef/Sites/WXYZ/MNO/Application Contexts/Connect On Demand/Sections/Self Service/* returns "::" expected at position 92. where as I am ...
Meghan's user avatar
  • 427
6 votes
1 answer
996 views

Item Language Fallback doesn't work for Sitecore query

This is for Sitecore 7.5 update-2 version. We are using Item-level Language Fallback and everything works fine except this piece gives error every time except when in Page Editor mode. item.Axes....
Harsh Baid's user avatar
  • 1,994
6 votes
1 answer
2k views

Why Multilist with search is not showing data in case of data source content setup in multilingual?

We have found one issue when we add a data source to the field MULTILIST with search it works fine but in case if we add a new language version for that data source then it’s giving only first three ...
Jitendra soni's user avatar
5 votes
2 answers
4k views

Why we should not use fast queries in Sitecore

As per blogs and best practices of Sitecore, its advised that fast queries should be avoided. The reason for that is fast queries will directly access the DB and fetch the results which causes ...
Anjo's user avatar
  • 405
5 votes
1 answer
616 views

Sitecore Query - Restrict to context Language (in RSS feeds)?

I am using Sitecore's RSS feed, which has a field for Items. You can set this field to a Sitecore query to find items within your website to show within your RSS feed. I have it configured like so: ...
jdylanmc's user avatar
  • 1,492
4 votes
3 answers
1k views

Site navigation - how to best to set the active class of all parent items of the current context page item?

I have a multilevel navigation control and I would like to add an active class and aria-expanded="true" to the <a> tag when one of the item's descendants' ID matches the Html.Sitecore()....
Sirius_B's user avatar
  • 601
4 votes
2 answers
3k views

Is it possible to use a Sitecore query to set an item's data source?

I have a branch template that is used to create a landing page with related content. I want to set the data source of the parent page's content sublayout to the parent page's content item child. test-...
Sirius_B's user avatar
  • 601
4 votes
2 answers
4k views

Retrieving multiple items in treelist query

How can I get a query-based treelist to return a list of items relative to the current item, that fits a template, instead of only the first result Search structure: -Parent Item --Segments ---Item ...
Jesper Hoff's user avatar
4 votes
1 answer
1k views

How to Join MongoDb Collections Using Sitecore Mongo Db Report Data Source

Am using sitecore 8.0, below code gets the analytics from the mongo db. I have two collections "ineractions" and "ContactId", I want to join both the collections using common field "contact" from ...
Suresh R's user avatar
  • 349
4 votes
3 answers
11k views

Using Sitecore fast:query to grab all items under a specified page excluding items in a specific folder

I'm using the following query as a Source for my Droplink field: query:fast:/sitecore/content/Home/AboutPages//*[@@templateid!='{41BF6376-A2D4-4CF1-80C5-223067C84811}'] My intention is for this ...
c-bro's user avatar
  • 567
4 votes
1 answer
533 views

Multiple queries for a droplink - removing duplicates

So, I have multiple organizations content on my site, they are all grouped into a regional content area, and I also have a global content area. One of my templates looks into a folder that has a ...
Levi Wallach's user avatar
  • 1,085
3 votes
4 answers
613 views

Creating a very large footer menu efficiently

I have a scenario where each page of a site has a checkbox for "is in header" and "is in footer". The universe of items that needs to be traversed is a couple of hundred in nature, and I'm looking for ...
Ken McAndrew's user avatar
  • 5,112
3 votes
1 answer
13k views

How to query for items under @@id with specific @@templateid

I'm trying to query a folder under the media library which has a bunch of templates based on a custom File template. I've tried to play around with a couple approaches but none of them have been ...
uioporqwerty's user avatar
3 votes
1 answer
4k views

Get item by Display name in sitecore

How can I fetch the item by display name? The below code is not working: string url = string.Concat("fast:/sitecore/content/KeenanDirect/#" + string.Format(blogtype) + "#//*[@@Display name='", ...
Ravindran's user avatar
3 votes
1 answer
1k views

Source Query using the current language version

I have a source query over a standard Multi-List field and I want the query to retrieve items based on the current selected language. Is there any attribute that could handle that in the source query?...
Tareq Mansour's user avatar
3 votes
2 answers
2k views

Results are not coming in the order using sortorder from lucene index

I have some items present in an item folder and want them to retrieve from Lucence index. There is a requirement that we have to order items in the Sitecore based on the order set on the Sitecore CMS, ...
Sudheer Suggu's user avatar
3 votes
1 answer
163 views

Sitecore 7.2 Analytics DB records grown in size to 200 GB+

Sitecore 7.2 Analytics DB records has grown in size to 200 GB+. Does anyone know of any recommendation for purging old data and this is a production setup so the impact of this data being removed ...
Umar D's user avatar
  • 169
2 votes
1 answer
4k views

Get Current Item children by fast query

Using Sitecore 8.2 and the content tree looks like: sitecore |_Content |_Home |_Products |_Product 1 |_Product 2 |_Services |_Service 1 |_Service 2 The items ...
sukesh's user avatar
  • 3,176
2 votes
2 answers
578 views

Sxa tokens not taken into account in code query

I am working on a custom field which is based on :https://marketplace.sitecore.net/en/Modules/A/Advance_Image_Field.aspx I am trying to make it suitable for SXA by changing the way to find thumbnails....
Joey Novais's user avatar
2 votes
1 answer
687 views

Where to find Visit Duration and Latest Date Visited in Code Behind

I am creating a process that reads in the Sitecore analytics contact collection and gets information needed for a report. It is read and inserted in SQL Server. Not sure how to get some of the fields ...
RReilley's user avatar
  • 755
2 votes
2 answers
1k views

MVC Areas using with Sitecore 8.2 Update1

We have a requirement to work with MVC Areas in Sitecore 8.2 Update1 CMS application. We tried to use the Area field in Item definition, but view engine is still searching in the default controller ...
Hari Prasad Kotha's user avatar
2 votes
1 answer
414 views

Get Sitecore Items based on the dates by using graphql

I have a requirement to fetch the news items in between the fromDate and toDate. fromDate and toDate need to pass as a parameter so i am unable to forming the query. for your reference please find the ...
Saiprasad's user avatar
2 votes
1 answer
864 views

Sitecore query with two paths?

I'm configuring an RSS feed in Sitecore, and I'm using a query to select my items. I have a huge number of articles under /sitecore/content/articles/issues organized into folders by year (e.g. /2010, /...
Erica Stockwell-Alpert's user avatar
2 votes
1 answer
699 views

Template field | Exclude filter on basis of template for TreeList and TreelistEx

Sitecore version: 9.0.2 What I am trying to do: I have created a template. In one of the fields, I need to have my data type as 'TreeList'/ 'TreelistEx'. 'TreelistEx' is preferred. The functionality ...
NutsAndBolts's user avatar
  • 1,342
2 votes
1 answer
4k views

How to query multiple datasources & multiple templates in sitecore query

The content tree is as follows: sitecore |_content |_Site1 |_Home |_Articles |_Category |_article1 |_article2 |_Site2 |_Home |_Rewards |...
sukesh's user avatar
  • 3,176
2 votes
2 answers
2k views

Sitecore Fast Query not returning never published item

I have a people node which consists of 3500 people. Out of 3500 people 2600 items are marked as NeverPublished=True. So in Web database I have only 900 items. i want a fast query on master database ...
Nitish Srivastava's user avatar
2 votes
1 answer
51 views

Sitecore Template Source Query issue

So I have a multilist with search field that I ONLY want to add the items under my home folder per region. So I want my us site settings file to only pull in the US home items and then the CA Site ...
Michael Jones's user avatar
2 votes
1 answer
763 views

Droptree field source query to filter on base templates

I am looking to add a source to the Droptree field. This is working fine, but the issue is that it allows all the templates under the home item to be added. But I want to limit it to only items which ...
Arun Kumar's user avatar
2 votes
1 answer
2k views

Any way to filter a treelist with just the source property of the template field?

I have a treelist that I'm pointing at a folder for items, which works fine, but when I attach some kind of filtering clause, like /*[@@tid='{ID}'] it just defaults to the root of the sitecore content ...
Levi Wallach's user avatar
  • 1,085
2 votes
1 answer
2k views

Treelist to show the all the items in which have the items derived from templates mentioned in IncludeTemplatesForSelection parameter

I want to achieve the Treelist in such a way that it shows up all the ancestors of an item which is derived from the template mentioned in the IncludeTemplatesForSelection parameter of the query. ...
Shaurya's user avatar
  • 457
2 votes
1 answer
613 views

Controller action not called due to rendering datasource containing query:/

The existing project is upgraded from Sitecore 8.0 to Sitecore 9.0u1. After that, I've observed that few renderings are not working. The root cause is, controller rendering datasource query. If ...
venkat's user avatar
  • 398
2 votes
1 answer
214 views

how to delete item in dropdown list wffm

can we delete list item in WFFM? I want to delete "3HUTCHISON" from dropdown field, but when i clicked (x)(delete) nothing happened. i am new to sitecore, i need to make 48 items for dropdown list ...
Vsn's user avatar
  • 197
2 votes
1 answer
370 views

fast querying items restored from the bin

I deleted an item located at /sitecore/content/foo/bar with several subitems from Sitecore and restored it back from Recycle Bin immediately. Now I'm able to see all the subitems if I run a query in ...
Elena P's user avatar
  • 631
2 votes
1 answer
1k views

Showing selected folder from the content node in tree-list is not working

Showing selected folder from the content node in tree-list is not working. We have used the below query but looks like only parent node is visible not the child nodes. DataSource=/sitecore/content/...
Jitendra soni's user avatar
2 votes
1 answer
487 views

Query item in Xpath [closed]

i have 2 sites, A and B in Sitecore. Some items in site A are linked to items in site B. I need a query to list all items in site A that are linked to any items in site B. I can't touch in code. Any ...
Đặng Tú's user avatar
2 votes
1 answer
105 views

Sitecore datasource query by comparing pubDate to current date RSS Feeds

So I have this query: query:$home//[@@name='blogs']//[@@templatename='BlogArticle' and contains(@date, '202208')] It works fine, but my goal is to compare the value of the @date field to the current ...
Pinpaho's user avatar
  • 61
2 votes
0 answers
580 views

Build Scope Query to Get First level of Children

I am using Sitecore 9.1.1 and SXA 1.8.1 I have an item called Seat, this item is a parent to many other items on multiple levels of two templates, Topic Details and Topic Listing. In Seat (my parent ...
Mariam Nasr's user avatar
2 votes
2 answers
1k views

Multilist with Search to return descendant items

I am working on Multisite Sitecore instance and For "multilist with search" field I am trying to return all descendant items under folder item from a specific template using these queries ...
Haneen Daoud's user avatar
2 votes
0 answers
155 views

Item Query not returning results when search with custom field in Arabic language

I am using Item Query to get featured Items using Isfeatured field in template, so my query like this: +template:{A0ABC519-3848-4930-965A-90F9F1B7F319};custom:isfeatured|true;language:english It is ...
NAli's user avatar
  • 875
1 vote
2 answers
6k views

Multilist source query to exclude items whose parent has a specific template id

I'm on Sitecore 8.1 and I have an item that has a multilist that allows a user to select all items under a site, but I want to exclude a couple items and their descendants. The basic tree structure ...
Mark J.'s user avatar
  • 21
1 vote
1 answer
3k views

How to use Sitecore Item Web Api and query for a Sitecore item with a particular value in the field?

I am trying to query for a Sitecore item where a particular field has a particular value but am not successfull in doing so. I am trying to do http://sc8/-/item/v1/?query=/sitecore/content/Home/*[@...
Midhun's user avatar
  • 11
1 vote
1 answer
3k views

Fieldsource query for droptree field

Is it possible to use query for Droptree field in Sitecore 8.1? In a multisite solution, I would like to point Droptree field source to an item in that particular site. Is this possible?
Vijaya Akkenapally's user avatar
1 vote
1 answer
805 views

Sitecore 10.1 Fast Query CompositeDataProvider System.NullReferenceException

I have faced an issue with fast queries in Sitecore 10.1. When I execute SelectSingleItem fast query: Database.GetDatabase("master").SelectSingleItem($"fast:/sitecore/system/Modules//*[...
x3mxray's user avatar
  • 3,150
1 vote
1 answer
73 views

sitecore query from field value

I'm trying to make Sitecore Forms easier for my content editors to use. They use the Content Editor and never touch layouts, controls, or renderings. I've made an item template with a single droptree ...
Brian Heward's user avatar
1 vote
3 answers
263 views

How to filter items that have at least one child with an specific template using Sitecore query

It's easier to explain what I'm trying to do with an image, so let's go! I need a query to get all parent items that have at least one Promotion Content as a child. The same for the contrary, I need ...
André Andrade's user avatar