Commits

Anonymous committed f49a5d1

killed another todo.

Comments (0)

Files changed (2)

docs/main/Config/Rendering.rst

 name to ``base_config.renderers`` but for custom renderers you want to
 set the renderer up, and set it in this dictionary directly.
 
+
+Making a module available to all Genshi templates 
+---------------------------------------------------
+Sometimes you want to expose an entire module to all of the templates
+in your templates directory.  Perhaps you have a form library you
+like to use, or a png-txt renderer that you want to wrap with <pre>.
+This is possible in TG.
+
+First, we must modify our app_cfg.py so that you can share your
+link across all templates::
+
+  base_config.variable_provider = helpers.add_global_tmpl_vars 
+
+Next, you want to modify the lib/helpers.py module of your application
+to include the newly added ``add_global_tmpl_vars`` method::
+
+  import mymodule
+  
+  def add_global_tmpl_vars():
+       return dict(mymodule=mymodule) 
+
+That's pretty much it, you should have access to mymodule in every
+template now.
+
 Overriding AppConfig Rendering Methods
 ---------------------------------------
 
 
 .. todo:: Difficulty: Medium. Include these docs: http://groups.google.com/group/turbogears/browse_frm/thread/3afbc13d88af57d3?hl=en TG2, repoze.who and multiple auth sources 
 
-.. todo:: Difficulty: Medium. Include these docs: http://groups.google.com/group/turbogears/browse_frm/thread/31c4268417c5033c?hl=en Making a module available to all Genshi templates
-
 .. todo:: Difficulty: Medium. Include these docs: http://groups.google.com/group/turbogears/browse_frm/thread/1c4158ad3035082c?hl=en Secure Static Files TG2
 
 .. todo:: Difficulty: Medium. Include these docs: http://groups.google.com/group/turbogears/browse_frm/thread/55d6bb9704b3127a?hl=en Accessing configuration
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.