robrtc
robrtc

Reputation: 2727

Get Tridion URI from a Page Publish Path?

I would like to get a Page URI from the Tridion Page PublishPath (URL from public site).

I know I can use the WebDavURL to get the Page - but there are many cases where this does not match the Page Path (such as the case when the Page Filename is 'News Home' but the filename is 'index').

I currently do not think this is possible in Tridion and have thought about the following solutions:

  1. Store the Page Publish Path in the Tridion Solr Index (by extending it) Customized Tridion Search Index Handler: Custom vs Standard field for page url?
  2. Use the Event System and persist the PublishPath and Uri to an external DB / KeyValueStore.

Other ideas?

This code would be used in a script that updates many pages but also for Editors to open a Page using the Page URL.

Upvotes: 1

Views: 448

Answers (2)

Chris Summers
Chris Summers

Reputation: 10163

This may be considered an odd approach, but could you query the Broker to get the PageMeta by URL, and then you will be able to access the the URI from the PageMeta object?

Just a thought - but it is probably not ideal - Can you share some more background on the problem?

Upvotes: 3

johnwinter
johnwinter

Reputation: 3624

I'm assuming you need to do this CME side? Is performance a factor?

You could build a function in Tom.net or the CoreService to split the path you have and loop through the sgs and pages till you arrive at the correct content page. As long as the path information hasn't been changed since the page published, this should map together.

Upvotes: 0

Related Questions