[MKDoc-users] RE: MKDoc demo, up and running...:)

Jean-Michel Hiver jhiver@cisedi.com
Tue, 23 Oct 2001 10:12:27 +0100


Hi Jay,

> Just curious: Is it possible to use another templating system -- I was
> thinking specifically of HTML_Tree, which uses valid HTML templates that are
> parsed into a DOM, and then programmatically modified to use the content
> nodes. Or another system?

The advantage of HTML_Tree is that you can view pages "as they are" in
WYSIWYG editors. Although I understand that can be nice, IMHO that
limits the template features too much.

For example with the current template system when you write
<% loop name="Document:Children" %> you are really invoking a bit of
code (the flo::Record::Document::Children() method to be precise).

This bit of code is issuing a query on the database to retrieve the
document children. This means that the current template system really
allows you to transparently query the database and dynamically invoke
code without having to worry about anything, which it think is a good
tradeoff between the classical templating approach and programming pages
in the ASP / JSP fashion.

If we were using HTML_Tree, MKDoc would have to preload all the data that
MIGHT be used by the template before it can process it. Which is not good at
all, because templates can virtually access the whole site data!

I had a discussion with the team about this and we came up with
something that could be allright for WYSIWYG editing:

Instead of having:

<% loop name="blah" %>
  <% tons of template code
     which does not work very
     well with WYSIWYG %> 
<% end-loop %>

We would have:

<%
  [% loop name="blah" %]
    [% now the whole thing
      looks like ONE ASP tag
      rather than lots of
      ASP tags %]
  [% end-loop %]
%>
<div class="dummy">

  This will NEVER appear in the template output, but it's very useful
to visualize how the page may look once it's been parsed.

</div>

Of course, ASP here means "Another Script in Perl" :-) More seriously,
it'd be just a way to have a better syntax for WYSIWYG stuff.

I'll spend this week debugging (there are a minor HTML Tidy issues that
needs to be fixed, however I shall implement that system next week (it's
ranking #1 on my looong todo list :))

What do you think?
Best regards,
-- 
Jean-Michel Hiver - Software Director
jhiver@mkdoc.com  - http://www.mkdoc.com
+44 (0) 114 221 4968