PyLucid CMS Logo

How to use own templates in "generic" plugin

You can easy create our own widget with the generic plugin.

create a new template:

e.g. create own_generic_template.html with this content:

HTML
1
2
3
4
5
6
7
8
<dl>
  <dt>Variable one:</dt>
  <dd>{{ var1 }}</dd>
  <dt>Variable two:</dt>
  <dd>{{ var2 }}</dd>
  <dt>page language:</dt>
  <dd>{{ page_language }}</dd>
</dl>

Note: The Variable page_language comes from the global context. Useable keys are listed in the tag list (You find the 'tag list' link if you edit a template or a page)

Use the template 1:

Python
1
{% lucidTag generic template_name="own_generic_template.html" var1="Foo" var2="Bar" %}

result:
Variable one:
Foo
Variable two:
Bar
page language:
en

Use the template 2:

Python
1
{% lucidTag generic template_name="own_generic_template.html" var1=123 var2=456 %}

result:
Variable one:
132
Variable two:
456
page language:
en

0 comments for 'use own templates':
    there exist no comment for 'use own templates'
Leave a comment

django-processinfo: 5.5 ms of 359.7 ms (1.5%)