Change default link to 'User Guide' in Editor interface

Vote:
 

I was trying to find a way to change default link to webhelp.episerver.com and use one of our pages instead. Is there an easy way of acomplishing this as shown here in screen shot?

#266042
Nov 01, 2021 13:53
Vote:
 

Have a look at the ShellMenuProvider:

Maybe you can create your own implementation of UserGuideUrlProvider?

#266072
Nov 01, 2021 18:28
Vote:
 

Thank you Tomas for this tip but it seems that in version 11.32 this link is defined in ShellMenuProvider class

If I would to implement IMenuProvider interface in my custom class that has been decorated with the MenuProvider attribute and returned only one MenuItem from the GetMenuItems method (the desired one) I would still end up with link to 'User guide' added twice.

Once, the first time, with my desired link, and the second time with the default Optimizely help url.

How should one define that my CustomUserGuideUrlProvider is to be used instead of the default one? 

#266119
Nov 02, 2021 12:35
Vote:
 

I just tested with the latest version Episerver.CMS.UI 11.36.3, this worked for me. You can tell Episerver to use your version using the ServiceConfiguration attribute like this:

[ServiceConfiguration(ServiceType = typeof(UserGuideUrlProvider), Lifecycle = ServiceInstanceScope.Singleton)]
public class CustomUserGuideUrlProvider : UserGuideUrlProvider
{
    public CustomUserGuideUrlProvider(ICurrentUiCulture currentUiCulture, ServiceAccessor<RequestContext> requestContext) : base(currentUiCulture, requestContext)
    {

    }

    public override string Url => "https://www.gulla.net";
}

And the quick warning: https://marisks.net/2018/01/31/serviceconfiguration-attribute-considered-harmful/

If you want to override the displayname in the menu too, have a look at this blog post: https://blog.novacare.no/change-text-in-the-episerver-ui/

#266129
Nov 02, 2021 17:21
Vote:
 

I have tried this and as you've wrote it worked with the hard coded values. As soon as I switched to a method call it stopped working.

Method would return an absolute path to a defined page. That page would be defined as a content reference on the start page. Helper method works if called from any other controller. 
I went back to hard coded values but things got strange. Break point wouldn't be hit at all and the URL showed just the default webhelp value.

Removed the singleton decoration - still nothing. Renamed the class - nothing. I removed it from the code, got the solution cleaned and rebuilt - still nothing. 
After restarting the machine I would get the break point set on override to get hit. At last i replaced the direct call of the method to use the string interpolation format - $"{MethodCall()}"; and it worked locally. Deployed the code to DXP integration and there it worked but, further down the deployment road, it stopped working on DXP preproduction. 

It didn't help with the cache purge, site restart or re-deployment. It simply doesn't register this custom Url provider.

I understand that this sounds strange but for me this is a very random behavior. Any thougths on this?

#266176
Nov 03, 2021 22:01
Vote:
 

Could you try removing the ServiceConfiguration attribute, and registering your UserGuideUrlProvider like this instead?

[InitializableModule]
[ModuleDependency(typeof(ServiceContainerInitialization))]
public class UserGuideInitializer : IConfigurableModule
{
    public void ConfigureContainer(ServiceConfigurationContext context)
    {
        context.Services.AddSingleton<UserGuideUrlProvider, CustomUserGuideUrlProvider>();
    }

    public void Initialize(InitializationEngine context)
    {
        
    }

    public void Uninitialize(InitializationEngine context)
    {

    }
}

Hopefully, the ModuleDependency will do the trick :-)

#266354
Edited, Nov 07, 2021 20:03
Vote:
 

Thank you Tomas! That did the trick.

#266450
Nov 09, 2021 15:09
Vote:
 

If you want to update the link text too, have a look at the last part of this post:
https://www.gulla.net/no/blog/replace-the-link-to-the-optimizely-user-guide/

#266522
Nov 10, 2021 14:09
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.