I am following this article to extend treelist field - https://jammykam.wordpress.com/2016/01/06/specifying-query-and-parameters-for-sitecore-treelist-field-source/.

We want to have a treelist field with support of query and other datasource parameters. But adding a query with token is causing issue. This query is working - datasource=query:$site/Data/Topic Whereas this is not - datasource=query:$sharedSites/Data/Topic

This is because $sharedSites token is getting converted to lowercase and its not getting resolved. Do we have any way of handling this with modifying the query?

  • What version of Sitecore you have? Commented Aug 4, 2022 at 11:00
  • Its Sitecore 10.1 Commented Aug 4, 2022 at 11:06
  • In the article, you are following they are using CompareCaseInsensitive method for this. Did you try? Commented Aug 4, 2022 at 11:12
  • Yeah...seems like that is for comparing two variables there. Not working with token Commented Aug 4, 2022 at 11:18
  • If you are using this in SXA you might want to read ggullentops.blogspot.com/2020/10/…
    – Gatogordo
    Commented Aug 5, 2022 at 8:12

1 Answer 1


looking at this it is because in the treelist SetProperties it sets the Datasource to LowerInvariant

Something like this should work

private string CasedDataSource => StringUtil.ExtractParameter("DataSource", this.Source).Trim();

and use that for all additional logic

  • Thank you, Matt Commented Aug 4, 2022 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.