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. So instead of looking for an ID I would like to use query with SXA tokens.
Sadly it throws an error :
Field control has failed to render: End of string expected at position 5.Details Sitecore.Data.Query.ParseException: End of string expected at position 5. at Sitecore.Data.Query.QueryParser.Raise(String error) at Sitecore.Data.Query.QueryParser.DoParse(String query) at Sitecore.Data.Query.Query..ctor(String query) at Sitecore.Data.Query.Query.SelectSingleItem(String query, QueryContext contextNode, Database database) at Sitecore.Data.DefaultDatabase.SelectSingleItem(String query) at HagerDeep.Foundation.Media.Fields.ImageWithFocusCrop.GetThumbnails() in D:\BitBucket\DEEP2\src\Foundation\Media\code\Fields\ImageWithFocusCrop.cs:line 639 at HagerDeep.Foundation.Media.Fields.ImageWithFocusCrop.DoRender(HtmlTextWriter output) in D:\BitBucket\DEEP2\src\Foundation\Media\code\Fields\ImageWithFocusCrop.cs:line 202 at Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at Sitecore.Shell.Applications.ContentEditor.EditorFieldContainer.RenderChildren(HtmlTextWriter writer)
Here's my code that throw the error:
var thumbnailFolderItem = Client.ContentDatabase.SelectSingleItem(ThumbnailsFolderQuery);
With the following query using SXA token :
query:$site/*[@@name='Presentation']/*[@@name='Thumbnails Ratio']/*[@@name='Fallback Thumbnail Folder']
Do I use the right function ? Or does the SXA tokens are not supported in code ?