1

We recently upgraded Tridion from version Web 9.1 to Web 9.5. On the content delivery side, Tridion.ContentDelivery.Meta.PageMetaFactory.GetMetaByUrl() always return NULL on 9.5.

var factory = new Tridion.ContentDelivery.Meta.PageMetaFactory(publicationId);
var meta = factory.GetMetaByUrl(publicationId, uri);

Any idea what could be the reason for this?

1
  • Have you tried one of the overloads that takes a publication, e.g. .GetMetaByUrl(publicationId, url)?
    – Neil
    Commented Jul 6, 2021 at 8:40

2 Answers 2

2

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!

0

For this to work I think you need to add the page url including file extension, e.g.: ".html"

Just in case you missed that.

1
  • uri param has '/index.html'
    – ragmn
    Commented Jun 30, 2021 at 15:16

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.