Matt Brailsford
unread,May 10, 2012, 3:57:18 AM5/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dotliquid
Hey Guys,
I've been poking around the source, as I would love to add support for
master templates to DotLiquid, but am struggling to make any headway.
What I would like to achieve, is to add a declaration at the start of
a template like so:
{% master '~/views/master.liquid' %}
and then have it merge the current template in with the master
template. In addition, I'd love to add support for areas, so in the
master template you do something like:
{{ head_area }}
{{ body_area }}
and in the child template, you implement an area by using:
{% area 'head' %}
// Some content here
{% endarea %}
then when they are merged, it looks up {{ xxx_area }} tags and
replaces them with the relevant implementation in the child template.
Any content not defined in an area, would just become a part of a
default {{ body_area }} tag.
My thought would be to do this all as pre-processing, so build up the
dynamic template, and then pass that through the parser, but I'm
struggling to find the best place to add this.
Could anyone give me some pointers on how I might go about doing this?
and the best place to start?
Many thanks
Matt