[ZPT] (no subject)

Magnus Heino magnus.heino@rivermen.se
Thu, 28 Jun 2001 22:00:03 +0100


-------------------
> From: "Magnus Heino (Rivermen)" <magnus.heino@rivermen.se>
> > Something like this; <span tal:define="zpt parse:here/foo"
> > tal:replace="structure ztp" /> and the actual request would be
> printet...
> >
> > Does anyone understand what I want to do? :)
> 
> Have you looked at METAL macros in ZPT?  I *suspect* that they're
what
> you want, though I can't be sure without an example.

Ok.

I am using the Forumlator product to handle forms. A form is a
Folderish object that contains all form elements, like text fields,
integer fields, password fields etc. You can setup validation on
fields etc, so it's really nice.

Then I have one ZPT that I can call to render the Formulator form,
something like this;

<form>
  <table>
    <tr tal:repeat="element here/form/get_all_elements">
      <td tal:content="element/render" />
    </tr>
  </table>
</form>

This ZPT will render like;

<form>
  <table>
    <tr>
      <td><input type="string" name="foo"></td>
    </tr>
    <tr>
      <td><input type="string" name="foo"></td>
    </tr>
  </table>
</form>


Now, if I want to have a value attribute on the input tag, I need to
set it like tal:attributes="value string:foo". This needs to go into
the element object in Formulator. But if I do this, it will RENDER
like;

<form>
  <table>
    <tr>
      <td><input type="string" name="foo" tal:attributes="value
string:foo"></td>
    </tr>
    <tr>
      <td><input type="string" name="foo" tal:attributes="value
string:foo"></td>
    </tr>
  </table>
</form>

You see? I need to parse this once again to get the result I want.

Or can i be done some other way?

/Magnus