1

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?

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

1 Answer 1

3

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

1

Your Answer

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

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