2

We put a line with tcm information in the head section of the html page.

Purpose is that Sitemanager & content people easier can find the page in content manager.

<head> 
  <meta name="tcm-info" content="tcm:99-417519-64" />
  ..

With DXA, the Publication Id is unknown. Model Id contains only that 417519.

It's possible to make a config value, but is there a value already for Publication Id?

1
  • That's helpful information for editors! If interesting to you or your site manager and content people, consider voting or commenting on this related idea to find items in the CMS by URL. Commented Jan 30, 2021 at 0:31

1 Answer 1

6

You don't need any separate configuration for that. In DXA there is a container called Localization to store the requested Publication information. You can retrieve the publication id from that localization.

Use the below line to get the publication id from your code

 WebRequestContext.Localization.Id

For more information about the localization you can check this class

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.