1

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.

Community
  • 1
  • 1
robrtc
  • 2,747
  • 1
  • 17
  • 22
  • 1
    Just a thought.. does oData webservice expose this information? – Puntero Oct 10 '12 at 17:46
  • 3
    That is indeed exactly what I did last time I needed to look up a page by its URL. `http://localhost:8080/cd_webservice/odata.svc/Pages?$filter=Url+eq+'/PlayStation3/Accessories/default.aspx'` – Frank van Puffelen Oct 10 '12 at 18:48

2 Answers2

3

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?

Chris Summers
  • 10,153
  • 1
  • 21
  • 46
  • I was thinking that approach too, but if the page isn't published yet this wouldn't work... which begs the question why would you want a url of something that isn't published. – johnwinter Oct 10 '12 at 15:56
  • This approach with the tip of Frank above is a great solution - thanks! – robrtc Oct 11 '12 at 09:17
0

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.

johnwinter
  • 3,624
  • 15
  • 24