Even better documentation for get_hook_templates!
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 30 Jan 2013 19:27:05 +0000 (13:27 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 30 Jan 2013 19:27:05 +0000 (13:27 -0600)
Tells how you *can* use it in templates if you really like.

mediagoblin/tools/pluginapi.py

index 5794bf635497ced2fcc85bf82857dd97252bca64..8321d73d3fbcb345bcc998d946df0e937b2f28db 100644 (file)
@@ -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)