"Custom" hooks is a new idea that, to be perfectly frank, has yet to be polished. Think of this feature as Very-Much-In-Beta. I thought it would be helpful to use the Hooks Manager to insert snippets of markup/code in other places throughout the application, not just in the predetermined template and hook locations. For instance, it would be nice to use the Pages modules to insert dynamic content - e.g. lists of forms, lists of submissions - and not just static HTML content. Or perhaps it would be handy to be able to have hooks within some of the modules.
This is what this feature is about.
As a simple example of this hook, upgrade to the latest version of the Pages module. Then follow these steps:
- In the Hooks Manager, create a custom hook and enter "hello_world" for the Custom Hook field.
- Select "HTML" as the content type.
- Enter "Hello World!" as the content.
- Go to the Pages module and create a new page.
- Select "Smarty" as the content type and enter the following into the Page Content field:
- Finally, return to the Pages main page (the one that lists all Pages) and click the "VIEW" link. Notice that the custom hook you entered has been replaced by whatever hook content you entered!