Re: Cheetah's #include base directory

"R. Tyler Ballance" <[email protected]> Tue, 26 Jan 2010 20:43:33 -0800
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
On Tue, 26 Jan 2010, Aahz wrote:

> On Tue, Dec 29, 2009, R. Tyler Ballance wrote:
> > On Tue, 29 Dec 2009, Pablo Antonio wrote:
> >> 
> >> Thing is some files have an '#include "<file>"' at the top. They usually
> >> include some header with the DOCTYPE and a title and that's pretty much
> >> it. Well, the problem is this <file> is being searched in the current
> >> directory the app is located, and not in the ./templates/ dir which is
> >> where the templates are.
> > 
> > Personally I don't use the #include directive ever (I find it too much
> > like Smarty (read: hacky)).
> 
> All right, how do you do create global template elements such as page
> footers?  I want to write them in Cheetah rather than Python because
> they're primarily HTML.

I use inheritance between pre-compiled templates (since it's tricky to do with
dynamic compilation), here's an example:

base.tmpl: http://github.com/rtyler/urlenco.de/blob/master/Urlencode/views/base.tmpl
index.tmpl: http://github.com/rtyler/urlenco.de/blob/master/Urlencode/views/index.tmpl

Cheers,
-R. Tyler Ballance
--------------------------------------
 Jabber: [email protected]
 GitHub: http://github.com/rtyler
Twitter: http://twitter.com/agentdero
   Blog: http://unethicalblogger.com

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)

iEYEARECAAYFAktfxHUACgkQFCbH3D9R4W8L6wCfZU3by3ot3Mfw3ZxiyuK1FnWw
sDUAnAy1VrMa+7d/dC59rD98fJh52gus
=Gfjw
-----END PGP SIGNATURE-----