ThesisSkinsUnplug → Hooks

Unplug Skin Hooks

You can use hooks to interact with the Unplug Skin in a programmatic way. This is great for developers or webmasters who need to inject content (or anything else) in a scalable, flexible manner.

Hooks Common to All Templates

  • hook_before_html — insert anything before the HTML output (just after the opening <body> tag) on every page
  • hook_after_html — insert anything after the HTML output (just before the closing </body> tag) on every page

Template- and Context-specific Hooks

In the Unplug Skin, the following elements each have four hooks associated with them by default:

  • featured_area
    • featured_area_container
    • post_box_featured_area
      • byline_featured_area
  • header
    • header_container
      • header_title_area
      • header_navigation
  • columns
    • content
      • post_box_main
        • headline_area_main
        • headline_area_front_page
        • byline
      • post_box_archive
        • headline_area_archive
      • post_box_landing_page
        • headline_area_landing_page
      • comments_post
        • comments
          • comment_body
            • comment_head
            • comment_footer
        • comment_form
        • trackbacks
      • comments_page
      • prev_next
    • sidebar
  • footer
    • footer_container
      • footer_columns

If each of the above elements can be represented by $hook, then the four hooks available on each element are as follows:

  • hook_before_$hook (before the opening tag)
  • hook_top_$hook (just after the opening tag)
  • hook_bottom_$hook (just before the closing tag)
  • hook_after_$hook (after the closing tag)

To illustrate, using the header element as an example, these are the four hooks:

  • hook_before_header (before the opening tag)
  • hook_top_header (just after the opening tag)
  • hook_bottom_header (just before the closing tag)
  • hook_after_header (after the closing tag)

The trackbacks element only includes before and after hooks.

As you can see, the Unplug Skin provides a ton of specific hook locations for you to reference. And if you don’t see an available hook where you want to inject some content, you can always create your own hooks wherever you want!