Replace the link to the Optimizely User Guide
The Optimizely (formerly Episerver) user interface has a link to the User Guide.
If you want to replace this link with your own, you can!
Step 1 - create your own UserGuideUrlProvider implementation
Return your preferred URL.
public class CustomUserGuideUrlProvider : UserGuideUrlProvider
{
public CustomUserGuideUrlProvider(ICurrentUiCulture currentUiCulture, ServiceAccessor<RequestContext> requestContext) : base(currentUiCulture, requestContext)
{
}
public override string Url => "https://www.gulla.net/en/blog/";
}
Step 2 - register your implementation with the DI container
[InitializableModule]
public class UserGuideInitializer : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Services.AddSingleton<UserGuideUrlProvider, CustomUserGuideUrlProvider>();
}
}
Step 3 - update the link text (optional)
You can do this with an XML file as described earlier.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<languages>
<language name="English" id="en">
<episerver>
<shell>
<ui>
<resources>
<menuprovider>
<userguide>My User Guide</userguide>
</menuprovider>
</resources>
</ui>
</shell>
</episerver>
</language>
</languages>
The updated User Guide menu item with the custom link and link text.
That's it!
Found this post helpful? Help keep this blog ad-free by buying me a coffee! ☕