From ec553298ff78646b0b91f9f2329448bfc690e3a9 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 30 Jan 2013 13:27:05 -0600 Subject: [PATCH] Even better documentation for get_hook_templates! Tells how you *can* use it in templates if you really like. --- mediagoblin/tools/pluginapi.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mediagoblin/tools/pluginapi.py b/mediagoblin/tools/pluginapi.py index 5794bf63..8321d73d 100644 --- a/mediagoblin/tools/pluginapi.py +++ b/mediagoblin/tools/pluginapi.py @@ -252,8 +252,16 @@ def get_hook_templates(hook_name): ... which will include all templates for you, partly using this method. + However, this method is exposed to templates, and if you wish, you + can iterate over templates in a template hook manually like so: + + {% for template_path in get_hook_templates("media_sidebar") %} +
+ {% include template_path %" +
+ {% endfor %} + Returns: A list of strings representing template paths. - """ return PluginManager().get_template_hooks(hook_name)