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
1answer
2k 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 ...
9
votes
2answers
7k 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 ...
9
votes
0answers
4k 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 ...
8
votes
2answers
9k 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 ...
7
votes
2answers
662 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 ...
6
votes
4answers
1k 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 ...
6
votes
1answer
853 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....
6
votes
1answer
1k 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 ...
5
votes
2answers
3k 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 ...
5
votes
1answer
512 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: ...
4
votes
3answers
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()....
4
votes
2answers
2k 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-...
4
votes
2answers
3k 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 ...
4
votes
1answer
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 ...
4
votes
1answer
284 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 ...
3
votes
4answers
581 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 ...
3
votes
1answer
3k 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='", ...
3
votes
3answers
9k 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 ...
3
votes
1answer
750 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?...
3
votes
1answer
133 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 ...
2
votes
1answer
3k 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 ...
2
votes
1answer
10k 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 ...
2
votes
2answers
320 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....
2
votes
2answers
988 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 ...
2
votes
1answer
171 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, /...
2
votes
1answer
576 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 ...
2
votes
2answers
1k 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 ...
2
votes
1answer
71 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 ...
2
votes
1answer
1k 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 ...
2
votes
2answers
1k 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, ...
2
votes
1answer
501 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 ...
2
votes
1answer
206 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 ...
2
votes
1answer
338 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 ...
2
votes
1answer
724 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. ...
2
votes
1answer
800 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/...
2
votes
1answer
437 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 ...
2
votes
0answers
295 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 ...
2
votes
0answers
148 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 ...
1
vote
2answers
4k 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 ...
1
vote
1answer
2k 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/*[@...
1
vote
1answer
2k 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?
1
vote
1answer
134 views

Sitecore Solr query in C# combination of AND and OR condition

I want to search all the pages, based on "Template A" or "Template B" or "Template C" and page should be inside this location "/sitecore/content/Home/Services/" ...
1
vote
1answer
529 views

Sitecore keywords in the metadata

Lets say we have 4 renderings on the Page and each rendering has a data source attached to it which has a Keyword field that is being used for SEO purpose. Is it possible to get all the attached ...
1
vote
1answer
160 views

Issue with publishing in Sitecore, datasource is not set for few items

I have a Sitecore 8 project where we have created a component for the editors to use. On that editor we used product detail where image carousel is being used to display images. An image carousel ...
1
vote
2answers
169 views

Sitecore 9.2 Query not returning all matching items on Azure production

We have multiple environments for a website including local, UAT (single Azure instance), CM (Azure production for authoring) and CD (content delivery). The following code is on all instances and ...
1
vote
1answer
250 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 ...
1
vote
1answer
147 views

Sitecore JSS component datasource xPath query

I am having following content tree Sitecore Content myapp home -Products -Product-1 Related-Products-1 (based on Related-Products custom template) – having multi-list field in which we can ...
1
vote
2answers
3k views

Setting up Datasource in templates

I have a Droplink field and I am trying to set the data source in the templates. What I want to do is set the data source by id instead of path and also add a filter by templates For example query:/...
1
vote
1answer
111 views

SXA Search box - add SXA token support to Rendering parameter for SearchPageResults

We have an SXA Search box defined on a partial design in our Master Shared site. The problem is we need to have the SearchPageResults rendering parameter field use a query to pull the search results ...
1
vote
1answer
1k 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 |...