Try our conversational search powered by Generative AI!

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


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

Feb 17, 2015 14:12


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;
Feb 17, 2015 17:00

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;
Feb 17, 2015 17:05

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

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.