[Zope] Comparing directories & dumb question

Ausum Studio ausum_studio@hotmail.com
Thu, 5 Dec 2002 15:17:23 -0500


Let's assume 'folder_name' is 'Sports'. Provided you've been careful of not
using this name anywhere else in your site (that's what you usually must do
when use folders as sections):

<dtml-if Sports>
   I'm at Sports section
<dtml-else>
   I'm at any other section
</dtml-if>



Ausum




----- Original Message -----
From: "BZ" <bz@bwanazulia.com>
To: <zope@zope.org>
Sent: Thursday, December 05, 2002 1:33 PM
Subject: [Zope] Comparing directories & dumb question


> I am trying to write a snippet of code that will figure out what main
> directory you are in and display a different banner based on that. Should
> be simple as heck, well... it has been driving me crazy. Here is what I
> have and I know I am missing one stupid line of code or something.
>
> dtml-let section="_.string.split(_.string.lower(_.string.split(URL,
> '/')[3]), '.')">
>   <dtml-call "REQUEST.set('section', section)">
> </dtml-let>
>
> <dtml-if section>
>
> <dtml-if "section=='folder_name'">
>
>   show new header
>
> <dtml-else>
>
>  do something else
>
> </dtml-if>
>
> </dtml-if section>
>
> And this is the output and why it won't match which I think is because the
> first one is in a list. (??!)
>
> ['folder_name'] = folder_name
>
> Any help?
>
> BZ
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )
>