Dotiac::DTL::Addon::importloop: Import loop variables into the top level namespace
Load from a Dotiac::DTL-template:
{% load importloope %}
Load in Perl file for all templates:
use Dotiac::DTL::Addon::importloop;
Then it can be used in the template:
posts=>[ {Title=>"test",Content="A test post",Date=>time}, {Title=>"My first post",Content="Nothing to say here",Date=>time-3600} ] {% importloop posts %} <h1>{{ Title }}</h1> {# Title is now in the main namespace #} {{ Content|linebreaks }} <em>{{ Date|date:jS F Y H:i" }}</em> {% empty %} No entries {% endimportloop %}
via CPAN:
perl -MCPAN -e "install Dotiac::DTL::Addon::importloop"
or get it from https://sourceforge.net/project/showfiles.php?group_id=249411&package_id=306751, extract it and then run in the extracted folder:
perl Makefile.PL make test make install
Adds the {% importloop %} tag
Dotiac::DTL::Tag::importloop: The importloop Tag.
This will make Dotiac slower.
Please report any bugs or feature requests to https://sourceforge.net/tracker2/?group_id=249411&atid=1126445
Dotiac::DTL, Dotiac::DTL::Addon, http://www.dotiac.com, http://www.djangoproject.com
Marc-Sebastian Lucksch
perl@marc-s.de
To install Dotiac::DTL::Tag::importloop, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dotiac::DTL::Tag::importloop
CPAN shell
perl -MCPAN -e shell install Dotiac::DTL::Tag::importloop
For more information on module installation, please visit the detailed CPAN module installation guide.