DOMinclude Widget
| Status: | Official |
|---|
- Author:
- Christian Heilmann, Kevin Dangoor
- Maintainer:
- TurboGears project
- Release information and download URL:
- http://pypi.python.org/pypi/DOMinclude
- SVN repository:
- http://svn.turbogears.org/projects/tgDOMinclude
Overview
DOMinclude is a TurboGears widget project that wraps the DOMinclude JavaScript library for DOM-based popups.
Here's a screenshot of the DOMinclude widget demo in action:
Usage
You can view a demo of the widget in the TurboGears Toolbox. Start the Toolbox with
tg-admin toolbox
The Toolbox will open in your default web browser. Open the WidgetBrowser and scroll down to the DOMinclude widget.
To use the DOMinclude widget in your TurboGears application, you need to import the dominclude.DOMinclude widget class and pass an instance of it in the dictionary returned by your controller method to the template:
from dominclude import DOMinclude
dominclude_widget = DOMinclude()
class MyController(controller.Controller):
@expose('yourpackage.templates.dominclude_demo')
def DOMinclude_demo(self):
return dict(dominclude=dominclude_widget)In your template, you need to call the DOMinclude widget instance with two arguments: the value of 'href' parameter must be the URL of page to display in the DOMinclude popup and the 'text' parameter specifies the text of the link with which the popup can be activated.
Example:
${dominclude(tg.url('/static/syntax_help.html'), text="Show syntax help")}For more information about DOMinclude configuration options, see the parameter descriptions of the DOMinclude and the DOMincConfig widgets in the WidgetBrowser.
Installation
You can install the DOMinclude widget package via easy_install:
[sudo] easy_install DOMinclude
Requirements
DOMinclude is compatible with TurboGears 1.0 widgets therefore it requires the Kid templating language. You can use TurboGears widgets within Genshi templates, but the widgets will use Kid for their templates.
References
- For more information about the DOMinclude JavaScript library, visit its homepage at http://onlinetools.org/tools/dominclude/.
- For information about TurboGears widgets, see the Guide to the TurboGears Widgets Documentation.