On Sat, 21 Jul 2001, Lambert Muhr wrote:
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).
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).
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
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.
my problem: how can I - within a dtml-in-tag - check whether the current sequence-item is a specific one:
<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="sm_id == '[current submenu_id]'"><a href="traversal_url"><dtml-unless> <dtml-var submenu-titel> <dtml-unless expr="sm_id == '[current submenu_id]'"></a><dtml-unless> </dtml-in>
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.
To not show the link for the current page: <dtml-let me=getId> <dtml-in submenu-sql-method> <dtml-if "sm_id == me"> <a href="&dtml-traversal_url;"><dtml-var submenu-title></a> <dtml-else> <dtml-var submenu-title> </dtml-if> </dtml-in> </dtml-let> However, you probably want to check something like "am I on a page *within* the submenu section, and if so, change the nav bar", in which case you could do it at least two ways: * look at your current location, using methods like PARENTS[] or URL, to find where you are in the hierarchy; or * set a property in each 1st-level folder of your site, setting the submenu id for that area. This is how we do it at www.scw.org. Our site looks like this: /about /board /catalog /consult /trainers but our "top level navigation" is coarser -- the section are just "about", "training", and "consulting". So, in each folder is a property called something like submenu_name, which contains /about = about /board = about /catalog = training /consult = consulting /trainesr = training and then, when you're within that section, the topNav method changes the apparance of the link. NB: I'm not sure that taking away the link is the best idea. When you're deep into subsection 2, having a link back to the top of subsection 2 is sometimes desired, and the logical place to go is the link. We keep it a link, but highlight it to make it obvious that 'you are here' -- Joel Burton <jburton@scw.org> Director of Information Systems, Support Center of Washington