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?
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.
//hack the 'Learn more about this widget link'
var helpLink = dojo.query('.help-link');
helpLink.href = 'https://gis.calhouncounty.org/WAB/V2.9/widgets/eSearch/help/eSearch_Help.htm';
Or you can have the link go to a help doc in the widgets folder by using a url like this.
helpLink.href = this.location.href.replace('?id=','apps/') + '/widgets/eSearch/help/eSearch_Help.html';
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.
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.