TGLightWindow

TGLightWindow wraps up LightWindow as widget.

Image paths are adjusted so it works with TG. There are no further modifications.

how to use

The only use-case is to pass the instance lightwindow to your template for having CSS und JS included at render time. Then, you qualify a link of yours (by setting class to lightwindow) within the template to have it opened as layer above your page:

import turbogears as tg
from TGLightWindow.widgets import lightwindow

class MyController(tg.controllers.Controller):

    @tg.expose("path.to.your.template")
    def example(self):
        # do something
        return {'lightwindow': lightwindow,
                ...}

Excerpt from template in which TGLightWindow is used in:

    <a href="/my/page/for/1" params="lightwindow_type=external" class="lightwindow page-options">My Page For 1 (with new scripts on that page)</a>
    <a href="/my/page/for/2" params="lightwindow_type=page" class="lightwindow page-options">My Page For 2 (everything that is in BODY)</a>

If link target does not have a line-ending such as .html you will have to explicitly specify parameter lightwindow_type.