Sanko Robinson > Template-Liquid > Solution::Tag::Include



Annotate this POD

View/Report Bugs
Module Version: v1.0.3   Source  


Solution::Tag::Include - Include another file (Functioning Custom Tag Example)

Synopsis ^

    {% include '' %}

Description ^

This is a demonstration of extending Template::Liquid.

If you find yourself using the same snippet of code or text in several templates, you may consider making the snippet an include.

You include static filenames...

    use Template::Liquid;
    use Solution::Tag::Include;
    Template::Liquid->parse("{%include ''%}")->render();

...or 'dynamic' filenames (for example, based on a variable)...

    use Template::Liquid;
    use Solution::Tag::Include;
    Template::Liquid->parse('{%include inc%}')->render(inc => '');

Notes ^

The default directory searched for includes is ./_includes/ but this can be changed in the include statement...

    use Solution::Tag::Include '~/my_site/templates/includes';

This mimics Jekyll's include statement and was a 15m hack so it's subject to change ...and may be completly broken.

See Also ^

Liquid for Designers:

Template::Liquid's section on custom tags.

Author ^

Sanko Robinson <> -

License and Legal ^

Copyright (C) 2009-2012 by Sanko Robinson <>

This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or For clarification, see

When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See For clarification, see

syntax highlighting: