[Zope] ZPT ==> DTML conversion impossible?

Felix Ulrich-Oltean felix@chaptereight.com
Mon, 8 Jul 2002 17:36:05 +0100


Hi Jaroslav

Here's the page template snippet with <br> tags instead of <ul> and
<li>:

<div tal:define="siblings here/siblings.py">
  <div
     tal:condition="siblings"
     tal:repeat="folder siblings"
     tal:omit-tag="">

     <a href="folder"
        tal:attributes="href folder/absolute_url"
        tal:content="folder/getId">folder id</a>
     <br>
  </div>
 <p tal:condition="not:siblings"><b>There are no sibling folders here.</b></p>
</div>

Everything you want to repeat is inside the inner <div> tag, but by
adding the tal:omit-tag attribute, you tell it not to output the
<div>, only its contents.

Hope that makes sense.

If you still want to do it in dtml, the following will work:

<dtml-var standard_html_header>

<dtml-in siblings.py>
<a href="<dtml-var absolute_url>"><dtml-var title_or_id></a>
<br>
</dtml-in>

<dtml-var standard_html_footer>

Yes, it is shorter, but I think using page templates is more elegant
and is well worth learning.

Felix.

On Mon, Jul 08, 2002 at 06:05:23PM +0200, Jaroslav Lukesh wrote:
> Hi,
> 
> I was get following code sample from examples (Root
> Folder/Examples/Navigation). It is working standalone, but I need no
> <ul><li> tags, only simple <br> between listed items instead.
>