E R <[email protected]> writes:

> Is there away to specify a relative path for an INCLUDE directive?
>
> For instance, in template "a/b/c.tt2", the directive:
>
> [ INCLUDE foo.tt2 ... ]
>
> would access the template a/b/foo.tt2.
>
> or perhaps the syntax would be:
>
> [ INCLUDE ./foo.tt2 ... ]

The following MACRO does a quick-n-dirty job of generating a relative
path from the current component path

  [% MACRO relative(path)
       GET component.name.remove('[^/]+$') _ path;
  %]

  [% INCLUDE $relative('example') %]

-- Johan

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to