1

We have multiple sites. And for each site has content folder called "data". Our client wants that if he is going to add a rendering component to the page, the datasource would be coming from the data folder of the current editing site. But if he is going to change the content of a particular existing rendering component from the site, the datasource should be coming from the data folder of ALL SITES. Is this possible?

1 Answer 1

1
  • To return the datasource from "Data" folder of the current editing site, add below query in "Datasource Location" in rendering level:

    query:./ancestor-or-self::*[@@templatename='Site Root']/Global/Data

  • To return the datasource from the "Data" folder of all sites you use this query:

    query:..//*[@@templatename='Data template name']

enter image description here

2
  • Hi thanks for this. I am already done with this and what I need is the flexibility of the datasource. When adding component, it should show different datasource. When editing that component, it will show different datasource. Jul 22, 2019 at 3:16
  • if you have SXA you could do it with $site/Data query Apr 13, 2020 at 18:38

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.