0

Is it possible to get current running site name in .config or patch file in multiple site in Sitecore SXA ?

I did not find anything related to it.

4
  • Not exactly getting that you want to find out in your C# code or in Powershell? Commented Jun 15, 2022 at 16:18
  • 1
    As Michael mentioned SXA does not store site names in config files. What is your actual problem?
    – Gatogordo
    Commented Jun 15, 2022 at 17:48
  • I am trying to override .config file in muliple site environment and each site has unique page to show through patch file. If I will get Sitename in patch file then it will resolve my issue.
    – Nisha
    Commented Jun 16, 2022 at 12:35
  • 1
    When working with SXA you shouldn't put site names in (patch) config files. Use the properties of the site instead as those can be set on the site item.
    – Gatogordo
    Commented Jun 16, 2022 at 12:51

1 Answer 1

2

Site names in SXA are not stored in configuration files. You can check out the SXA Site Manager found under the Toolbox to see what is available. You can use the Sitecore API to query for the sites.

enter image description here

enter image description here

2
  • Thank you for ur answer. Only one concern , can we use Sitecore API in .config file?
    – Nisha
    Commented Jun 16, 2022 at 6:15
  • The Sitecore API will combine results from the files and item provides. Commented Jun 16, 2022 at 12:21

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.