| view type | HttpResponse | inline | urls.py |
|---|---|---|---|
| lucidTag | - | X | - |
| http_get_views() | X | X | - |
| PluginPage | X | X | X |
| context middleware | X | X | - |
explanation:
used by e.g.: auth (insert login/logout link)
A lucidTag is the simples plugin API. It's nice to insert dynamic stuff into a page. The Admin can insert lucidTag into PageContent or into the global page template.
The plugin must only defined a lucidTag function in the views.py file and return a string/unicode content.
The lucidTag is a django template tag, witch called the view function. It's allways available.
Defined in pylucid_project/apps/pylucid/defaulttags/lucidTag.py
tag syntax looks like this:
for surounding the plugin output with a DIV or SPAN tag the plugin template can extends from css_anchor_div or css_anchor_span, e.g:
used by e.g.: auth login/logout views
Requested via http GET Parameter.
e.g.: domain.tld/en/pageslug/?auth=login
view can return:
used by e.g.: blog plugin
A PluginPage is one type of plugin PageTree. The plugin has his own urls.py file. These urls would be "inserted" at the PageTree point.
The admin must create a PageTree entry from type plugin and select the plugin.
It's for "big" plugins witch has more than one view.
The template/output must extends from template, e.g.:
To 'insert' a page into the django admin panel, extends from admin/base_site.html, e.g.:
used by e.g.: breadcrumb
see also: http://forum.pylucid.org/viewtopic.php?t=276&highlight=context+middleware (de)
plugin has a context_middleware.py with a ContextMiddleware class witch has a render method.
context middleware plugin are inserted via a special tag:
The Plugin ContextMiddleware.render() method should return None or a HttpResponse object. The content from the response would be replace the tag.