Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi
I don't believe the 'PageEditing' will give you what you want however you could try using the urlresovler:
var virtualPathArguments = new VirtualPathArguments { ContextMode = ContextMode.Edit};
var url = ServiceLocator.Current.GetInstance<UrlResolver>().GetUrl(currentProduct.ContentLink, "de", virtualPathArguments);
This is by no means production code though might help point you in the right direction.
Thanks
Thank you for your answer, I tried this already, this also results a url inside CMS interface, but invalid for my Commerce content.
I haven't tried this however this is based upon the PageEditing.GetEditUrlForLanguage.
string.Format("{0}/?language={1}#context=epi.cms.contentdata:///{2}", ModuleResourceResolver.Instance.ResolvePath("Commerce", null).TrimEnd('/'), language, contentLink)
I'll have a play around later and see if I can come up with something solid.
There should be away to do it, as the Optimizely quicknavigation can do it.
My collagaue found EPiServer.Web.Routing.EditUrlResolver.GetEditViewUrl(), which is working great for CMS and Commerce, apparently other variants should not be used.
Thanks for your help.
Zsolti
Hi,
Using Commerce 13.34.
When generating edit link for a Commerce content with PageEditing.GetEditUrlForLanguage(), it always returns a link to CMS instead of Commerce, so context is invalid, meaning instead of link
https://localhost:44377/EPiServer/Commerce/Catalog?language=de#context=epi.cms.contentdata:///65__CatalogContent&viewsetting=viewlanguage:///de
it returns something like
https://localhost:44377/EPiServer/CMS//?language=de#context=epi.cms.contentdata:///-2147483640__CatalogContent
Is there a way to generate an edit link correctly in Commerce content? Apparently PageEditing hardcodes "CMS" in implementation.
Regards,
Zsolt