Sitecore query to determine the data source in the current context

Share:

Use a Sitecore query to determine the data source in the current context

Data Source query in Rich Text Editor

When you open the rich text editor you may see basic functionality, to enable full or specific functionality in the editor you can configure it as follows based on your requirement.

  • /sitecore/system/Settings/Html Editor Profiles/Rich Text Default
  • /sitecore/system/Settings/Html Editor Profiles/Rich Text Full
  • /sitecore/system/Settings/Html Editor Profiles/Rich Text IDE
  • /sitecore/system/Settings/Html Editor Profiles/Rich Text Medium
  • /sitecore/system/Settings/Html Editor Profiles/Rich Text XA

Template Data Source

rich text editor template source

Screenshot : rich text editor template source


rich text editor different configurations
Screenshot : rich text editor different configurations

Query

  • query:.//* - Children of the current page
  • query:$home  Home item of the current site
  • query:.. - Parent item of the current page
  • query:../.. - Parent of the parent item of the current page
  • query:$home//* - Every item under site home page
  • query:$home//*[@@name='News'] - Every item under site home page with additional sorting applied
  • query:.//*[@@templatename='Page'] - All items of the Page template under the current item
  • query:$site/*[@@name='Home']//*[@@templatename='Page'] - All items of the Page template under the Home item of the current site

SXA tokens query

  • query:$siteMedia - Path to "virtual media folder" located under site
  • query:$site - Path to the current site
  • query:$home - A home item of the current site
  • query:$linkableHomes - Paths home items from linkable sites
  • query:$templates - Path to the current site-templates
  • query:$theme - Currently used theme
  • query:$compatibleThemes - Path to all themes
  • query:$xaRichTextProfile - Returns XA.Foundation.Editing.DefaultRichTextProfile setting value.
  • query:$sitelang - The context site language.
  • query:$vf - The virtual folder for the context site.
  • query:$partialDesigns - The root of partial designs
  • query:$pageDesigns - The root of page designs
  • query:$sharedSites - For multi-root fields, resolve shared site for current tenant.
  • query:$lang - The context language.
  • query:$rvSystemTemplates - Returns a list of templates defined in a configuration. Those templates are used to feed the AllowedInTemplates field for rendering variants.
  • query:$currenttemplate - The name of the current template
  • query:$tenant - Path to the current tenant

Hi! I am Sartaj Husain. I am a Professional Software Developer, live in Delhi. I write blogs in my free time. I love to learn and share the knowledge with others because it is no good to try to stop knowledge from going forward. So free posts and tutorials. more..

No comments