Skip to main content
Further investigation to update answer
Source Link
Neil
  • 6.7k
  • 14
  • 22

I would raise this with Support.

For the same page in a Tridion Sites 9.1 implementation, I tried using the GetMeta(int pageId) and found it returned null, but GetMeta(string pageUri) does not.

UPDATE

Be careful with the parameters your using here, when initialising and calling the method.

The PageMetaFactory constructor expects a string or an int. If you pass a string it must be a TCM URI, so not, as in my case(!), a integer as a string, e.g. "19". This is easy to do if your just passing WebRequestContext.Localization.Id in DXA.

The same applies, in my case, to the GetMeta method, if you pass a string, it must be a TCM URI, not, as in my case(!), an integer as a string e.g. "161091". Again, easy to miss if you just pass PageModel.Id in DXA!

Turned out it worked perfectly ... when given the right params!

I would raise this with Support.

For the same page in a Tridion Sites 9.1 implementation, I tried using the GetMeta(int pageId) and found it returned null, but GetMeta(string pageUri) does not.

I would raise this with Support.

For the same page in a Tridion Sites 9.1 implementation, I tried using the GetMeta(int pageId) and found it returned null, but GetMeta(string pageUri) does not.

UPDATE

Be careful with the parameters your using here, when initialising and calling the method.

The PageMetaFactory constructor expects a string or an int. If you pass a string it must be a TCM URI, so not, as in my case(!), a integer as a string, e.g. "19". This is easy to do if your just passing WebRequestContext.Localization.Id in DXA.

The same applies, in my case, to the GetMeta method, if you pass a string, it must be a TCM URI, not, as in my case(!), an integer as a string e.g. "161091". Again, easy to miss if you just pass PageModel.Id in DXA!

Turned out it worked perfectly ... when given the right params!

Source Link
Neil
  • 6.7k
  • 14
  • 22

I would raise this with Support.

For the same page in a Tridion Sites 9.1 implementation, I tried using the GetMeta(int pageId) and found it returned null, but GetMeta(string pageUri) does not.