How do to include help doc with custom widget deployed to Portal?

166
4
12-07-2018 07:43 AM
deleted-user-997AEHHSB7nZ
New Contributor II

We deploy custom widgets to ArcGIS Portal (following prescribed workflow - Add custom widgets—Portal for ArcGIS | ArcGIS Enterprise) but we'd like to include a help doc along with our widget (like you can in Dev Edition - Add help for your widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers ).  Is there a supported way to do that?

missing learn more link

0 Kudos
4 Replies
DerekLaw
Community Moderator

Hi Pete,

Please take a look at these GeoNet threads,

Activate help link on home made widget 

https://community.esri.com/message/669750-help-widget 

Hope these help,

RobertScheitlin__GISP
MVP Esteemed Contributor

Derek's links are what the WAB dev team have provided for adding help to a custom widget. I still find this to be a bit to involved and heavy handed when try to provide a simple help link for your custom widget. Here is a hack snippet of code I use to make my widgets link to help docs on a web server.

In the widget settings.js setConfig function.

    setConfig:function(config){
      //hack the 'Learn more about this widget link'
      setTimeout(function(){
        var helpLink = dojo.query('.help-link');
        helpLink[0].href = 'https://gis.calhouncounty.org/WAB/V2.9/widgets/eSearch/help/eSearch_Help.htm';
        html.setStyle(helpLink[0],'display','block');
      },600);
...‍‍‍‍‍‍‍‍

Or you can have the link go to a help doc in the widgets folder by using a url like this.

helpLink[0].href = this.location.href.replace('?id=','apps/') + '/widgets/eSearch/help/eSearch_Help.html';
deleted-user-997AEHHSB7nZ
New Contributor II

Thanks guys - appreciate the quick answers!  The snippet you provided Robert Scheitlin, GISP‌ works in our test environment just fine thank you.  One question, why the setTimeout?  What needs to happen in that 600 ms before you run that code?  Is the help link not actually there yet?  I just wonder if there's a way to get this done without some kind of race condition.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Pete that is because the WAB core code searches for the help doc in the path that WAB expects to find the help in and when it can not it hides the link.