Skip to content

Instantly share code, notes, and snippets.

@adelcambre
Created September 19, 2008 18:17
Show Gist options
  • Save adelcambre/11629 to your computer and use it in GitHub Desktop.
Save adelcambre/11629 to your computer and use it in GitHub Desktop.
# in the article view
<%= render_plugin_views @articles.nil? ? "after_article" : "after_article_in_list", :with => article %>
# in the plugin init
Hooks::View.register_partial_view "after_article", "comments"
# in lib/hooks/view.rb
# This returns an array of the available view hooks
def available_hooks
["first_article_in_list", "last_article_in_list", "before_article", "before_article_in_list", "after_article", "after_article_in_list", "article_form_fields", "between_articles", "meta_section", "head", "header", "before_layout", "after_layout", "sidebar", "footer"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment