Try our conversational search powered by Generative AI!

Get url for page in /episerver/cms

Vote:
 

How can I generate/get an url to a page in the CMS?

Like this: http://localhost:49196/episerver/cms/#viewsetting=viewlanguage:///no&context=epi.cms.contentdata:///2650

Do I have to hard code it or is there any methods to use for getting the url?

#175679
Feb 27, 2017 11:59
Vote:
 

using the UrlResolver, you could set the context mode to "edit":

UrlResolver.Current.GetUrl(contentReference, language, new VirtualPathArguments() { ContextMode = ContextMode.Edit });
#175680
Feb 27, 2017 12:26
Vote:
 

There's also

PageEditing.GetEditUrl(contentLink);

or

PageEditing.GetEditUrlForLanguage(contentLink, language);



 

#175681
Feb 27, 2017 12:33
Vote:
 

That's even better :-)

#175682
Feb 27, 2017 12:36
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.