[Zope] dtml-newbie question: sql

Lambert Muhr lmuhr@web.de
Sat, 21 Jul 2001 11:18:22 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_003C_01C111D6.DA264820
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

the structure of my zope-site is fully based on relational mysql-tables.
I am generating, e.g., submenu-entries by selecting submenu-titel, =
submenu-id, submenu-text, submenu-image, etc., from the sql-table =
'submenu' and inserting them into the page as dtml-variables (with that, =
I manage to maintain a 4-level sitemap with users editing contents via =
some simple ms-access-masks).
=20
on a specific content page, e.g., the start page of submenu_1, I added a =
horizontal navigation list like:
submenu_1 || submenu_2 || submenu_3
by means of a <dtml-in submenu-sql-method> listing the <dtml-var =
submenu-titel>'s as well as their url's (traversal sql-methods).
=20
now, I want to escape the link-html-tag (<a href>) for that very =
sequence-item (submenu-entry) which is the one of the current page =
(e.g., when I am in submenu_2, I want to drop the (<a href>) for the =
sequence-item submenu_2):
submenu_1 || submenu_2 || submenu_3
=20
I tried this by means of a <dtml-unless> around the <a href>-tag, =
checking whether the current sequence-item is the same as the one the =
current page is being built on.
=20
my problem:
how can I - within a dtml-in-tag - check whether the current =
sequence-item is a specific one:
=20
<dtml-var standard_html_header>
<p>this is the submenu number <dtml-var submenu_id></p>
<p>navigate to any of the submenu-entries at the same level
<dtml-in submenu-sql-method>
<dtml-unless expr=3D"sm_id =3D=3D '[current submenu_id]'"><a =
href=3D"traversal_url"><dtml-unless>
<dtml-var submenu-titel>
<dtml-unless expr=3D"sm_id =3D=3D '[current =
submenu_id]'"></a><dtml-unless>
</dtml-in>
=20
I tried to set - outside of the dtml-in-tag - a variable using REQUEST:
<dtml-call "REQUEST.set('[current submenu_id]',????)">
but it seems I cannot replace ???? by <dtml-var submenu_id> which - =
content-wise - would be the solution.
=20
I would be grateful for any hint.
=20
thanks
lambert

------=_NextPart_000_003C_01C111D6.DA264820
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>the structure of my zope-site is fully =
based on=20
relational mysql-tables.<BR>I am generating, e.g., submenu-entries by =
selecting=20
submenu-titel, submenu-id, submenu-text, submenu-image, etc., from the =
sql-table=20
'submenu' and inserting them into the page as dtml-variables (with that, =
I=20
manage to maintain a 4-level sitemap with users editing contents via =
some simple=20
ms-access-masks).<BR>&nbsp;<BR>on a specific content page, e.g., the =
start page=20
of submenu_1, I added a horizontal navigation list like:<BR><A=20
href=3D"submenu_1">submenu_1</A> || <A href=3D"submenu_2">submenu_2</A> =
|| <A=20
href=3D"submenu_3">submenu_3<BR></A>by means of a &lt;dtml-in=20
submenu-sql-method&gt; listing the &lt;dtml-var submenu-titel&gt;'s as =
well as=20
their url's (traversal sql-methods).<BR>&nbsp;<BR>now, I want to escape =
the=20
link-html-tag (&lt;a href&gt;) for that very sequence-item =
(submenu-entry) which=20
is the one of the current page (e.g., when I am in submenu_2, I want to =
drop the=20
(&lt;a href&gt;) for the sequence-item submenu_2):<BR><A=20
href=3D"submenu_1">submenu_1</A> || submenu_2 || <A=20
href=3D"submenu_3">submenu_3<BR></A>&nbsp;<BR>I tried this by means of a =

&lt;dtml-unless&gt; around the &lt;a href&gt;-tag, checking whether the =
current=20
sequence-item is the same as the one the current page is being built=20
on.<BR>&nbsp;<BR>my problem:<BR>how can I - within a dtml-in-tag - check =
whether=20
the current sequence-item is a specific one:<BR>&nbsp;<BR>&lt;dtml-var=20
standard_html_header&gt;<BR>&lt;p&gt;this is the submenu number =
&lt;dtml-var=20
submenu_id&gt;&lt;/p&gt;<BR>&lt;p&gt;navigate to any of the =
submenu-entries at=20
the same level<BR>&lt;dtml-in submenu-sql-method&gt;<BR>&lt;dtml-unless=20
expr=3D"sm_id =3D=3D '[current submenu_id]'"&gt;&lt;a=20
href=3D"traversal_url"&gt;&lt;dtml-unless&gt;<BR>&lt;dtml-var=20
submenu-titel&gt;<BR>&lt;dtml-unless expr=3D"sm_id =3D=3D '[current=20
submenu_id]'"&gt;&lt;/a&gt;&lt;dtml-unless&gt;<BR>&lt;/dtml-in&gt;<BR>&nb=
sp;<BR>I=20
tried to set - outside of the dtml-in-tag - a variable using=20
REQUEST:<BR>&lt;dtml-call "REQUEST.set('[current =
submenu_id]',????)"&gt;<BR>but=20
it seems I cannot replace ???? by &lt;dtml-var submenu_id&gt; which -=20
content-wise - would be the solution.<BR>&nbsp;<BR>I would be grateful =
for any=20
hint.<BR>&nbsp;<BR>thanks<BR>lambert</FONT></DIV></BODY></HTML>

------=_NextPart_000_003C_01C111D6.DA264820--