[Zope] Is there a better way to code this?

Andrew Kenneth Milton akm@mail.theinternet.com.au
Tue, 4 Jul 2000 00:41:10 +1000 (EST)


+----[ Luke Tymowski ]---------------------------------------------
| Hello Andrew,
| 
| >You should set flags to say when it's safe to render the header/footer,
| >or you should remove the header/footer calls from documents you want to
| >embed.
| 
| Can't do the latter.
| I'm building a weblog. I need to have the user enter entries for each day. 
| I need for each day to display properly on its own - which means each needs 
| header and footer code.

No it doesn't. You need to seperate content, and structure.

Each day can simply be
<dtml-var standard_html_header>
<dtml-var day_content>
<dtml-var standard_html_footer>

Where day_content is what you have now sans header and footer.

I don't know your structure, but, this is how I would do it knowing that...

| And I need the front page to be created on the fly, 
| consisting of the three latest entries, but, of course, without the header 
| and footer code appearing in the body of the document.

Yep you can get the content...

| It now works as it should, but I want to know if there is a more elegant 
| way of doing what I want to do. No point pointing fellow newbies at 
| something and then have one of the gurus suggest I could have done it much 
| more simply and elegantly.

Yes there is, and then you don't need all that hackery in the header/footer.

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd          |  F:+61 7 3870 4477   | 
ACN: 082 081 472                     |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068    |akm@theinternet.com.au|