Menu

Mako-esque suggestion

Anonymous
2011-05-28
2013-05-02
  • Anonymous

    Anonymous - 2011-05-28

    One thing about Mako that I like a LOT more is that a header and footer template is unnecessary-one needs only to define a base template. One can define a variable in each page that is called 'title,' and each page's template 'inherits' the base template. The biggest advantage of this is that even though the content is in the middle of the page, the 'title' variable (in the page template) can still be accessed at the top of the base template.

    With SUIT, one must do something like this:

    [assign var="title"]Title of Page[/assign]
    [execute][template]header.tpl[/template][/execute]
    Content of the page
    [execute][template]bottom.tpl[/template][/execute]
    

    I don't really find this at all advantageous.

    It may be that there is a way to create a base template. I just haven't found it. I tried to do something like this:

    [assign var="content"][execute][template]page.tpl[/template][/execute][/assign]
    <title>[var]title[/var]</title>
    [var]content[/var]
    

    The title variable is, of course, defined in page.tpl. This just gave me a 500 error though. It could've been another reason I suppose.

    But yeah, just a suggestion.

     
  • Anonymous

    Anonymous - 2011-05-28

    Just kidding I'm dumb. print suit.execute(templating.rules, template). DUH.

     

Log in to post a comment.