Loading ...
Sorry, an error occurred while loading the content.

241Re: Templating suggestions?

Expand Messages
  • Joshua Chamas
    Mar 22, 2002
      > A typical page, foo.html, contains:
      > <my:template href="/templates/simple.html" />
      > <my:header>
      > Welcome back, <%= $Session->{'username'} %>!
      > </my:header>
      > <my:body>
      > <!--#include file="foo.inc" -->
      > </my:body>

      Glad its working out!

      Looking at your solution, I think I would probably do
      something more like:

      <my:template href="/templates/simple.html" />
      <my:header>Welcome back, <%= $Session->{'username'} %>!</my:header>
      <!--#include file="foo.inc" -->

      This would allow you to not have to do post processing in
      the Script_OnEnd. With the my:template enclosing my:header
      and my:body, you would guarantee the execution of the
      my:header & my:body before my:template, so when my:template
      executes the %vars data would already be define.

      This is a more natural use of the XMLSubs in my view, where
      inner tags get executed before outer tags.

      The only drawback to this approach is that $Response->Flush
      is disabled during XMLSubs execution, so you would not
      be able to flush a long running report data out periodically
      if the report were wrapped up in a <my:template/> tag,
      but your current method suffers from this same problem
      I believe.

      > Anyway, thanks again, Joshua. This stuff is great.

      I'm glad you are making use of all the hooks. Its really
      nice to hear of creative solutions to intricate problems
      like this.

      -- Josh
      Joshua Chamas Chamas Enterprises Inc.
      NodeWorks Founder Huntington Beach, CA USA
      http://www.nodeworks.com 1-714-625-4051

      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Show all 6 messages in this topic