template inheritance

2 views
Skip to first unread message

boorad

unread,
Jun 9, 2007, 11:04:53 PM6/9/07
to sgte - A simple Erlang Template Engine
Hi,

Is template inheritance working in sgte?

I'm trying to break Tobbe's main.sgte file apart, and I have created
login.sgte as a separate file. So, in main.sgte, I have this:

<html>
...
$login()$
...
</html>

I get the following:
[SGTE Warning: template: attribute - key 'login()' not found on line
145]

and I get the same thing, when I tried $login.sgte()$

I'm kinda new around Erlang, Eblog, and SGTE, so just wondering what
the status of inheritance is.

Cheers,
Brad

Filippo Pacini

unread,
Jun 11, 2007, 3:27:58 AM6/11/07
to boorad, sgte - A simple Erlang Template Engine
Hi,
sgte does not have inheritance. You can include templates placed in
other files using:

$include login$

and then you pass the compiled template to renderer along with other data.

E.g.

{ok, Login} = sgte:compile_file("login.sgte")
{ok, Main} = sgte:compile_file("main.sgte")
sgte:render(Main, [{login, Login}, ...])

cheers,
filippo

Reply all
Reply to author
Forward
0 new messages