Get page id from selected page when link type is "Fetch content from page in episerver cms"

Vote:
 

Is it possible to get the id of the selected page when link type is "Fetch content from page in episerver cms"

#117299
Feb 17, 2015 14:12
Vote:
 

Hi,

Yes that is possible. Untested code, but something like this should work:

var url = page["PageShortcutLink"];
var contentReference = ContentReference.Parse(url);
var pageId = contentReference.ID;
#117310
Feb 17, 2015 17:00
Vote:
 

Hmm I think PageShortCutLink is a PageReference already, so you should be able to do:

var pageReference = page["PageShortcutLink"] as PageReference;
var pageId = pageReference.ID;
#117311
Feb 17, 2015 17:05
Vote:
 

Thank's, for some reason I always forget those properties that are not strongly-typed... :-)

#117329
Feb 18, 2015 8:58
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.