[Catalyst] Templates in the database

Bill Moseley moseley at hank.org
Sat Jan 20 18:07:07 GMT 2007


On a related note...

When templates are on disk there's a nice hierarchy for
grouping templates.  Placing the templates in a table (say keyed by
path name) flattens out the templates name space.

It would be nice to preserve the hierarchy in the UI, so I'm wondering
how best to set that up in the database.

A tree-like expanding list is nice, of course.  But, I'm not clear how
bet to implement that in the database to support the display.

That is, I can have a simple column "path":

    create table template (
        path    text, -- e.g. user/profile/edit.tt
        ...
    );

which is easy to lookup when you know the name. Or, something like:

    create table template (
        name        text,
        parent_node int references template,
        ...
    );

Where name would be "edit.tt" and parent node would have its name
"profile", and so on.  And maybe a boolean to indicate if a node is
a leaf node.


-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list