There's a cool new event that blueyed told me about. No docs for it yet, but I propose that we use it and use it in some sort of consistent way. You can add documentation right into the plugin code, and put links to that help page, where ever you want. Here's what I did with my poll plugin.
First, put in the actual help page, like this:
function DisplayHelp ( & $params )
{
?>
Docs go here.
<?php
}
The user can find that by going to Settings > Plugins > Democracy Poll > Help, but I wanted to add a link in the Tools > Democracy Poll page. So I added this right at the top of my AdminTabPayload event:
echo '<div style="float:right">';
echo $this->get_help_link('#');
echo '</div>';
That puts the help icon in the top right of the page. If you put anchors in the help page, you can make contextual help links that go straight to that section, like this:
echo $this->get_help_link('#installation');
The get_help_link method can also point to the external help url:
echo $this->get_help_link( '#', '', true);
Maybe you already knew about this, but perhaps we can discuss the best way to use it. Also, I needed an excuse to use the amcode for the first time. B)
Recent Comments