Retrieving published URL of a Tridion page based on URI
Asked Answered
F

1

5

Does anyone know if we can retrieve the published URL of an SDL Tridion Page based on the URI? Ideally I would like to do this using the Core Service.

Fairlead answered 12/2, 2013 at 15:11 Comment(4)
This is very unclear what you are asking - please provide your existing code sampleAccepter
Thank you so much Chris Summers for your interest in my question. I already got a working answer of it though. Please see below...Fairlead
I understand you have an answer - but if you made your question more clear it would help other people in the community with a similar challengeAccepter
Thank you Chris Summers for updating my question. I am relatively new in Tridion 2011 so sometimes my questions might sound a little unclear...Fairlead
I
7

If you are talking about retrieving a Page's published URL, it can be done via:

PageData page = client.Read("tcm:12-345-64", null) as PageData;
PublishLocationInfo info = (PublishLocationInfo)page.LocationInfo;
string url = info.PublishLocationUrl;
Induplicate answered 12/2, 2013 at 15:42 Comment(3)
Page will still be returned (tested and ran) when read options are null, I believe just with the default option on.Induplicate
Do be aware that 1) the page may not be published and 2) its Url may have been modified somewhere down the publishing pipeline by any extension...Larainelarboard
Yes I am checking whether the Page is published before returning the URL. Thanks!Fairlead

© 2022 - 2024 — McMap. All rights reserved.