aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-01-30 13:27:05 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-01-30 13:27:05 -0600
commitec553298ff78646b0b91f9f2329448bfc690e3a9 (patch)
treea2a588931b6d9d5353c701d737bb9f38c6f48e1d
parentf097cf648c6f9d322a78bfbf3a677488ff495915 (diff)
downloadmediagoblin-ec553298ff78646b0b91f9f2329448bfc690e3a9.tar.lz
mediagoblin-ec553298ff78646b0b91f9f2329448bfc690e3a9.tar.xz
mediagoblin-ec553298ff78646b0b91f9f2329448bfc690e3a9.zip
Even better documentation for get_hook_templates!
Tells how you *can* use it in templates if you really like.
-rw-r--r--mediagoblin/tools/pluginapi.py10
1 files changed, 9 insertions, 1 deletions
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") %}
+ <div class="extra_structure">
+ {% include template_path %"
+ </div>
+ {% endfor %}
+
Returns:
A list of strings representing template paths.
-
"""
return PluginManager().get_template_hooks(hook_name)