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

2000-07-03 Thread Luke Tymowski

Hello Dieter,

>What about
>
> standard_html_footer='')">
>... your code without "REQUEST" mangling ...
>
>
>This redefines "standard_html_header/footer" inside the "with".
>Should work for DTML methods/documents.

It didn't work.

If I removed all my request mangling from the header and footer code, and 
from the index.html looping code, Zope generates an error:
Zope Error
Zope has encountered an error while publishing this resource.
Error Type: AttributeError
Error Value: __call__


If I leave my request mangling in the header and footer code, but do what 
you suggest above, it works, except that the footer code is inserted after 
the very first record retrieved, and once again at the end of the document 
where it should appear.

I suppose if I don't want hacks, as Andrew suggested, I should do a proper 
job of separating formatting from data.

Luke


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




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

2000-07-03 Thread Dieter Maurer

Luke Tymowski writes:
 > To have Zope ignore the footer code in one place but still display footer 
 > code on other pages, I've resorted to this:
 > 
 >
 >  
 >
 >
 >PermaLink
 > 
 >  
 >
 > 
 > 
What about


   ... your code without "REQUEST" mangling ...



This redefines "standard_html_header/footer" inside the "with".
Should work for DTML methods/documents.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




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

2000-07-03 Thread Andrew Kenneth Milton

+[ 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




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|[EMAIL PROTECTED]| 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




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

2000-07-03 Thread 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. 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.

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.

Luke


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




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

2000-07-03 Thread Andrew Kenneth Milton

+[ Luke Tymowski ]-
| Hello,
| 
| I'm still having trouble trying to get Zope to use/ignore header and footer 
| code in the appropriate places.

...snip...


| So. Is there a better way to do this? Or is the above meet and right and 
| not worthy of shame? I want to write a How-To so other newbies don't have 
| to go through what I did.

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.

-- 
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|[EMAIL PROTECTED]| 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




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

2000-07-03 Thread Luke Tymowski

Hello,

I'm still having trouble trying to get Zope to use/ignore header and footer 
code in the appropriate places.

To have Zope ignore the footer code in one place but still display footer 
code on other pages, I've resorted to this:

   
 
   
   
   PermaLink
    
 
   



My problem was that on the first sequence item returned, Zope would insert 
the footer code. On items 2 and 3, Zope would not display the footer code, 
and, again, at the end of the page, when I did want the footer code to 
appear, it wouldn't.

I had no trouble with the header code.
I assume it had no trouble with the header code because by calling it to 
display that document itself, Zope inserted the code and set the 
renderedheader to 1, causing it to be ignored elsewhere in the document, as 
it should.

So. Is there a better way to do this? Or is the above meet and right and 
not worthy of shame? I want to write a How-To so other newbies don't have 
to go through what I did.

thank you,

Luke


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )