[Zope] My first question.

Goldthwaite, Joe invalid at bar-s.com
Wed Dec 3 12:52:35 EST 2003


Ok I'll look into the METAL stuff.  I skimmed over it but it looked
confusing and didn't seem to apply to my current problems.  I guess it's
time to give it another look-see.

By the way, I checked my line and it does have the structure statement
in. Here's the page;

<html>
  <head>
    <title tal:content=3D"template/title">The title</title>
  </head>
  <body>
    <h2><span tal:condition=3D"template/title"
              tal:replace=3D"template/title">optional template
id</span></h2>
  =20
***  <span tal:replace=3D"structure here/IS_YTD_Header"></span> ***

    <tr tal:repeat=3D"item python:here.GetISLines(FY=3Drequest.FY,
Per=3Drequest.Per, OrgType=3Drequest.OrgType, OrgNo=3Drequest.OrgNo)">
       <td tal:content=3D"item/desc">desc</td>
       <td tal:content=3D"item/YtdCurrent" style=3D"text-align: right"></=
td>
       <td tal:content=3D"item/YtdLastYear" style=3D"text-align:
right"></td>
       <td tal:content=3D"item/YtdPlan" style=3D"text-align: right"></td>
       <td tal:content=3D"item/YtdPcntVariance" style=3D"text-align:
right"></td>
       <td tal:content=3D"item/YtdPcntVariancePlan" style=3D"text-align:
right"></td>
       <td tal:content=3D"item/YtdVariance" style=3D"text-align:
right"></td>
       <td tal:content=3D"item/YtdVariancePlan" style=3D"text-align:
right"></td>
     </tr>
    <span tal:replace=3D"structure here/IS_Ptd_Footer"></span>
  </body>
</html>

The highlights show the standard header that is a separate ZPT.  I
misspoke when I said that the result comes out quoted.  The header comes
out looking beautiful.  It's the rest of the document that gets quoted.
If I change IS_YTD_Header with IS_Ptd_Header, the non-header part of the
page comes out correct.  The only difference is the IS_YTD_Header is a
ZPT and IS_Ptd_Header is a DTML method.  Can someone explain that???

Joe Goldthwaite
I'm having more fun than should be allowed!


-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org]On Behalf Of
Paul Winkler
Sent: Wednesday, December 03, 2003 10:39 AM
To: zope at zope.org
Subject: Re: [Zope] My first question.


On Wed, Dec 03, 2003 at 10:01:08AM -0700, Goldthwaite, Joe wrote:
> My first question got lost in all the discussion of the second.  I'm
going
> to repost it in hopes of getting lucky.
>
>
> In order to keep my table headers consistent across reports, I have
them
> stored as a separate DTML method called IS_Ptd_Header.  In my main
Income
> Statement, I have this where I want the table header to show up;
>
> <span tal:replace=3D"structure here/IS_Ptd_Header"></span>
>
> This works fine.  The problem I've run into is when I want to use tal
tags
> in the IS_Ptd_header like this;
>
> Income Statement for period <span
tal:replace=3D"request/Per">Period</span>
>
> If I have this line in the Income Statement ZPT it works. I get the
"Per"
> parameter from the URL. When the same line in IS_Ptd_Header gets
ignored
> so the resulting page shows "Income Statement for period Period".  I
> thought that maybe the tal tags were being ignored because
IS_Ptd_Header
> is a DTML method

Correct. DTML and ZPT are completely different.

> so I created a ZPT with the name IS_YTD_Header and used
> that in the tal replace command but the result came back as HTML
quoted
> text instead of the actual HTML. Anyone know what I'm missing?

Yes. Output of tal statements is normally html quoted. You probably
left out the "structure" directive:

 <span tal:replace=3D"structure here/IS_YTD_Header"></span>

> It doesn't look like ZPT is designed to work this way.  For my footer,
> (for now) I just have the </table> tag to finish my table. The ZPT
> gives me a mismatched tag error.

Right. Each Page TEmplate is normally required to be valid XML.
You *can* disable this.  I forget how because I never do it :-)
But it's in the zope book, first Page TEmplates chapter.

> What's the best way to modularize
> the web pages?

METAL.
See zope book, Advanced Page Templates chapter.

--

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's SUPER-DE-DOOPER KILLJOY IZER!
(random hero from isometric.spaceninja.com)

_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )=20


Property of Bar-S Foods. This message is intended only for the use of the=
 Addressee and may contain information that is PRIVILEGED and CONFIDENTIA=
L.  If you are not the intended recipient, dissemination of this communic=
ation is prohibited.  If you have received this communication in error, p=
lease erase all copies of the message and its attachments and notify us i=
mmediately at 602.264.7272 or postmaster at bar-s.com.




More information about the Zope mailing list