I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Meet the reborn Google Ads plugin named Hooks Manager

The former Google Ads plugin was completely refactored - much code was rewritten, the name changed to Hooks Manager and the version bumped to 1.0.0. Also the UI has changed dramatically and much more hooks became available.
Added by Andriy Lesyuk over 11 years ago

Download Hooks Manager 1.0.0

To be honest, actually this plugin never was just about Google ads... The name was completely wrong, very confusing and limiting – I understood this soon after the release of the version 0.0.1 of the plugin. In fact the plugin allows much more than just adding ads – using it you can largely customize your Redmine. So I planned to rename this plugin a long time ago. And finally I did this!

Unfortunately the rename implies some minor troubles for users of the previous version of the plugin... Thus, in order to update the plugin you need to remove the folder with its previous version (but, please, don’t run the uninstallation migration) and install the new one as a completely new plugin! Largely this is required because the internal plugin name (which was sense) has also changed (to hooks_manager). Luckily the new version comes with the migration script intended for moving data from the previous version to the new one. Check also this section for more details...

Another problem of the previous version was its UI, which displayed the list of hooks as a static drop down list. Adding all available hooks would make this list large and, therefore, less readable. So new version comes with an improved and friendly UI allowing to change the way hooks are displayed (first by pages, then by location, or vice verse) and to hide extra hooks (ones, which are unlikely to be used commonly).

Certainly due to UI improvements the version 1.0.0 comes with all native hooks of Redmine (ones, which can be used to add custom HTML). In total the plugin currently comes with support for 41 hooks (however by default most such hooks are not visible and should be made available by clicking on the “Show all hooks” checkbox).

In addition the plugin can now load hook definitions from other plugins. So, if an other plugin supports the Hooks Manager, its hooks will be available in the list as well.

If you are developer of a Redmine plugin, check this page on how to register your custom hooks in the Hooks Manager.

Version 1.0.0 also comes with its own special hook :view_wiki_inline_content intended to be used in the Wiki content (e.g., Wiki page) with help of the !{{inline_hook}} Wiki macro. The design of this hook (and the macro) was greatly influenced by Google ads. Thus, the Wiki macro supports optional arguments in the format name=value. If specified, such arguments get transparently converted into JavaScript variables and, therefore, become available in the HTML/JS content. See the following page for a sample and cautions.

I have a feeling, that this way the macro can be exploited... So to disable the feature just do not define any HTML content for the hook! Currently no issues related to the feature are known though...
A note for ChiliProject users:
This version is not yet fully ChiliProject ready while it works fine under it. Thus, the plugin does not check, if the hook can be used by ChiliProject, and the !{{inline_hook}} Wiki macro is not compatible with ChiliProject’s Liquid.

The above mentioned change of the name introduces another trouble for those of you, who uses the SVN repository of the project, as the repository name has also changed! Anyway you will probably prefer to check it out to a new directory, as the plugin’s directory name also changed. If not, you will need to execute the following command to fix the repository URL:

$ svn switch --relocate http://svn.s-andy.com/redmine-google-ads http://svn.s-andy.com/hooks-manager

Comments

Terms of use | Privacy policy