Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Karsten Hoffmann
RE: Another question [ reply ]  
2006-02-23 18:11
Thanks again for your answers. It works quite well.

The "include_paths" directive is a really nice feature too.

By: Brian Wisti
RE: Another question [ reply ]  
2006-02-21 19:35
That's what I get for typing before thinking.

By: Greg Millam
RE: Another question [ reply ]  
2006-02-21 19:27
Actually, just a quick fix:

The syntax does not include quotes.

That is, use: [% include file.txt %]

As Wisti said, you can also define include paths, but his second example has a typo. It should be 'include_paths' instead of 'include_path'

Hope that helps!

- Greg

By: Brian Wisti
RE: Another question [ reply ]  
2006-02-21 19:00
Try it and see!

In other words, yes. Include functionality is part of PageTemplate. The syntax is as you described. If you don't want to put all of your templates in the application directory, you can mess about with the 'include_paths' parameter to PageTemplate's constructor:

PageTemplate.new('include_path' => "templates")
PageTemplate.new('include_path' => ["site_templates", "app_templates"])

By: Karsten Hoffmann
Another question [ reply ]  
2006-02-21 15:51
It's me again.

A short question: Is it possible to include external files in a template?

For example:

[%include "file.txt" %]

Karsten