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.
Retrieving published URL of a Tridion page based on URI
Asked Answered
This is very unclear what you are asking - please provide your existing code sample –
Accepter
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 challenge –
Accepter
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
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;
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.