Questions tagged [sitecore-query]
For questions related to the syntax of and issues with Sitecore Query notation
91
questions
1
vote
2
answers
127
views
Need help with a Query to select a data source context, for each site
I have a page template where when the site was setup it referenced the folder(Item ID), but now I have multiple sites and need it to reference ONLY the sites folders not just the main site. I am ...
0
votes
0
answers
17
views
Multiple root nodes for DropTree [duplicate]
I am using SXA and have multiple sites, I want DropTree to have two data sourcesas below.
/sitecore/content/Tenant1/SiteFolder/LocalSite1/Data/SomeFolder
/sitecore/content/GlobalSite/Data/SomeFolder
...
0
votes
1
answer
152
views
Find the home path of an item
I have custom button in Core database and I want to get the home path of an item.
This is the item /sitecore/content/Test/Retail/TestShop/home/whats-on/event-1
This is the home path '/sitecore/content/...
1
vote
1
answer
53
views
Sitecore Default Bucket Query For Multiple Templates
I need to build a sitecore default bucket query for a bucketable folder which will display the articles which are based on different page templates. I was not able to find a specific syntax which we ...
0
votes
0
answers
52
views
Replace Sitecore Tagging template __Semantics field source with relative path
My application is a multilanguage, multisite SXA application. I am trying to implement tagging based on multilanguage.
For that, I have created a Tagging folder for every site for that Site language.
...
2
votes
1
answer
329
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 ...
1
vote
1
answer
433
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/"
...
0
votes
0
answers
250
views
How to build Sitecore SXA Scope Search query with comoperations
I have requirement to show the query results based on the logged-in user-profile details, I was able to pass the query token field value dynamical by following the code.
How to write a SXA search ...
2
votes
1
answer
291
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, /...
1
vote
1
answer
162
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 ...
0
votes
1
answer
189
views
combined value of source property from 2 multilist fields to one [duplicate]
I have 2 multilist field in sitecore template.
below is value of source property for field1 and field2 and I'm getting list of items to select right side.
field1:
query:/sitecore/content/x/y/website/...
1
vote
2
answers
334
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
1
answer
178
views
Not able to get count from Search response using Glass Mapper
Environment details: Sitecore 9.0.2 with Solr and GlassMapper
I am using the method:
public IEnumerable<TModel> GetAll<TModel>(string query, string language) where TModel : class
...
1
vote
0
answers
154
views
Xpath field contains case-insensitive string
I've been searching here for a solution but at least when I've tried out the answers in the Xpath builder I always get errors. I'm using Sitecore 8.2. The current query is:
/sitecore/content/...
1
vote
1
answer
331
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
1
answer
2k
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
|...
0
votes
0
answers
121
views
Sorting a Sitecore query used to populate a droplink
We have a query that's populated a droplink that displays photo items. It's grabbing these items from multiple locations, so the query is concatenating those subparts of the query. I'm wondering if ...
2
votes
0
answers
391
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 ...
0
votes
1
answer
866
views
Sitecore Powershell - Get all items under buckets
I am trying to see if I can traverse through every node in a bucket and get all its items using PSE. All I am able to get is only the root bucket folder.
I tried all the below options with no luck.
...
0
votes
0
answers
487
views
Problems with spaces in SPE Sitecore queries
I am using Sitecore 9.0 and SXA 1.8 and scaffolded a new tenant and site named New Tenant and New Site. When executing the following query using SPE I get not results:
Get-Item -Path master:// -Query ...
1
vote
1
answer
201
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 ...
0
votes
1
answer
1k
views
Multi-root treelist with queries
I'm trying to use the Multi-root treelist that Kam Figy made and that Zachary Kniebel extended. I used this guide to add the Field-type to the Core database.
All is well, until I put query: anywhere ...
1
vote
0
answers
43
views
Multitennant Datasource locations for treelist
For input fields which support the query syntax its no problem like
Droplist
Grouped Droplist
DropLink
Grouped Droplink
Checklist
Multilist
Droptree
here I am using the following query
query:./...
1
vote
0
answers
42
views
Sitecore query to segregate items based upon selected value [duplicate]
Sitecore: 9.0.2 + SXA 1.7.1
What i was trying to do:
Inside a parent item 'Locations', i have multiple children items created on a common template. Each children item has a multilist field 'Location ...
1
vote
1
answer
134
views
Using part of an item name as query filter
So, I'm trying to work my way to what is essentially a great aunt/uncle of the context item and then looking to its descendents for specific item types.
So there's a folder and within that folder ...
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 ...
4
votes
1
answer
338
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 ...
0
votes
1
answer
161
views
set relative query to datasource
Each Article uses datasource underneath.
I'm using query to find CTA button of current item but it returns nothing.
query:.//Article Datasource/Article Top Content
.
2
votes
2
answers
413
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....
1
vote
1
answer
192
views
Multilist pick subcategory based on the category selection
I have a Categories Item and Each category has Sub categories
- Category 1
- Sub Category 1
- Sub Category 1
- Sub Category 1
- Category 2
- Sub Category 2
- Sub ...
9
votes
1
answer
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 ...
0
votes
0
answers
30
views
Sitecore AD configuration of component 1.3 without domain name Login
I have integrated with Active Directory 1.3 and Login is happening perfectly fine with with the username as domain\username and password.
My requirement is to just sign in without with domain. For ...
1
vote
2
answers
407
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
...
0
votes
2
answers
1k
views
Getting all items using a Specific Sublayout using Sitecore Powershell Extensions
I have to get data of rendering parameters used by a specific sub-layout. Is there a way to get all items which are using a particular Sublayout.
Example:
I have a Sublayout "SiteHeader" and it has a ...
1
vote
1
answer
289
views
Multilist with search not loading for non admin
Data on the left side of the multi-list is not loading if the user is a non-admin. I have multisite on a single node so on the data source I've put Sitecore query as StartSearchLocation=query:./...
1
vote
1
answer
623
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 ...
2
votes
1
answer
881
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.
...
0
votes
1
answer
467
views
Where is the value "Item owner: sitecore\smith" from "Quick Info" living in back-end SQL tables?
I'm unable yet to locate a particular "Item owner: sitecore\smith" value I see well-and-alive in Content Editor "Quick Info" of an item, but not in the SQL Server backend tables.
I often pull a ...
0
votes
1
answer
2k
views
using sitecore queries to search for items whose names contain a specific string
I'm using this line of code to search for items whose names are exactly the string i provide in the query:
string query = path + "//*[@@templatename = 'Template Folder' and @@name='" + year + "']";
...
0
votes
1
answer
437
views
How to sort items in a query inside a variant?
I need to sort items returning from a query inside a variant. For example query:.//*[@@templatename='Template']. I need to sort these items since it doesn't work through build query. Any ideas?
3
votes
1
answer
878
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?...
1
vote
1
answer
273
views
Get the list of languages of an item in a droplist field query source [closed]
As a source for a DropList, I would like to use a query that returns the list of languages defined for a specific item.
Is it possible?
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?
2
votes
2
answers
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, ...
1
vote
1
answer
541
views
How to get first child of an item in content tree?
I am trying to get only one item under a specific page in the content tree using a query in variant. I tried query:.//* but it gets all children under that item. I only need the first one. Any ideas?
1
vote
1
answer
558
views
SXA Add Query in the variant definition
I am using SXA 1.7 and need to add a Query item under my variant definition, I found that the query should be written using sitecore query format like "query:./*" to return the child items but it ...
2
votes
1
answer
555
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 ...
1
vote
2
answers
5k
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 ...
5
votes
2
answers
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 ...
8
votes
2
answers
11k
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 ...