I have a use case where I need to find the Page URL from a Page using a certain Component Presentation (given componentId
and templateId
).
I am trying to find the Page using Criteria
but I can't find the right combination.
I tried using ComponentLink.getLinkAsString
method but that method uses templateId
parameter as "exclude" instead of "preferred template".
I know the information is there but I can't find a way to it. I'm trying this:
criteriaURL.add(new ItemTypeCriteria(64));
criteriaURL.add(new ItemReferenceCriteria(ComponentId));
criteriaURL.add(new ItemTemplateCriteria(ComponentTemplateId));
Even using only ItemTemplateCriteria
and ItemTypeCriteria
, I don't get any results.