A sample view hook implementation
We will be glossing over a lot of implementation details as they are out of the scope for this book, but the full code will be available on the GitHub repository at https://github.com/alexbevi/redmine_knowledgebase.
Identifying the callback
We've determined that our plugin will be hooking into the existing issue tracking system in order to allow users to attach knowledgebase articles.
The desired functionality is the same as the Subtasks functionality that already exists, so we will model our hook after that.
Our first step is to determine which hook best suits our needs. In order to add additional functionality to the existing issues#show
view, we will choose the :view_issues_show_description_bottom
hook as it allows us to insert a partial just below the standard issue details form, as indicated in the following screenshot:
With the desired view hook identified, we need to define a listener class and tie that into our plugin initialization code.