0

I noticed a thing in SXA that on the new publishing target-based CD we have 2 connection strings like <add name="web" ...../> and <add name="preview" ..../>. When the web connection string's database name was like Sitecore.Web then Sitecore.Context.Database.Name was resolved as web and when web connection string's database name was like Sitecore.Preview then Sitecore.Context.Database.Name was resolved as preview.

I was under the impression that this depends on what DB you select in the Database field of Site grouping but it doesn't seem to be that.

Can you please let me know how this context dependency is there on the DB name?

2
  • What makes you think its not using the Site Grouping definition item?
    – Richard Seal
    Commented Jan 29 at 19:39
  • No, it doesn't matter what DB I select in the Database field it only considers the web, and also in the web, if it is web db then context is the web and in the web, if it is preview db then context is a preview. Commented Jan 30 at 5:39

1 Answer 1

-2

I assuming you actually created 2 different site definition under like

Settings-->Site grouping -->Preview site (Preview DB)

Settings-->Site grouping -->Public site (Web DB)

Both sites will have their own domain name, start path, and database field updated. If you are using Sitecore SXA, it will always take content from the Site definition database field, in this case if your preview site needs to point to preview database that you can specify here itself.

I hope this helps.

Reference :https://doc.sitecore.com/xp/en/developers/sxa/19/sitecore-experience-accelerator/the-sxa-site-definition-fields.html

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.