[rt-users] Include Template in another template

2014-09-05 Thread Tobias H.
Hey there,

I would like to know if there is any possibility to include a template
into another one.

To clearify what I would like to do: I want to put the name of the
company and some other legal information on the bottom of any email
that is outgoing, but in case of a change I don't want to edit every
template. So i just would like to create a template called Footer
and include this in every other template.


Thanks in advance,

Tobias
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training


Re: [rt-users] Include Template in another template

2014-09-05 Thread Kevin Falcone
On Fri, Sep 05, 2014 at 01:57:15PM +0200, Tobias H. wrote:
 I would like to know if there is any possibility to include a template
 into another one.
 
 To clearify what I would like to do: I want to put the name of the
 company and some other legal information on the bottom of any email
 that is outgoing, but in case of a change I don't want to edit every
 template. So i just would like to create a template called Footer
 and include this in every other template.

While you can load another template and parse it and included it, for
a footer I'd honestly write a tiny extension with

package RT::Site::Foo::Emails;

sub Footer {
return long footer string;
}

1;

install that and from my templates just call
{ RT::Site::Foo::Emails::Footer() }

and be done with it.

Loading and parsing and including another template is almost always
more error prone.

-kevin


pgp8AgWVYCDLN.pgp
Description: PGP signature
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training