Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Which version are you running? There is a bug reported for that issue, see https://world.episerver.com/support/Bug-list/bug/CMS-9578 that is fixed in CMS.Core 11.3.3
Hi,
are yopu getting the Contentlink on your Model.Settings.NewletterSuccess?
Running a version below 11.3.3 and currently there is no option to upgrade. I have tried the workaround suggested in the bug you linked with no success (getting the same results). Is there another way to get the friendly url of a page?
@Radek Yes, contentLink is available as usual
Thanks a lot!
Hi,
I am trying to get a friendly-url for a page of type ContentReference (property in site settings) in another page's controller.
In site settings:
public virtual ContentReference NewsletterSuccessPageRef { get; set; }
In the base controller I am populating the "Model" in override method OnActionExecuting():
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); var currentPage = filterContext.ActionParameters.First(ap => ap.Value is TPage).Value as TPage; var currentContent = filterContext.ActionParameters.First(ap => ap.Value is TContent).Value as TContent; Model = filterContext.ActionParameters.FirstOrDefault(ap => ap.Value is TViewModel).Value as TViewModel; InitializeModel(currentPage, currentContent); }
Other page's controller:
var urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>(); var url = urlResolver.GetUrl(Model.SiteSettings.NewsletterSuccessPageRef);
But I get a NullReference exception on line 21:
Debugging shows that neither the "urlResolver" nor the "SiteSettings.NewsletterSuccessPageRef" are null.
Any ideas why?
Regards,
Micha