Click here to register.
      
PBWG Banner


     Discuss > Web Design, Templates, and Themes

Dropdown Menu

User ministrycrm
Date 2/20/2008 2:53 pm
Views 913
Rating 1    Rate [
|
]
Previous · Next
User Message
ministrycrm

I am trying to build a css dropdown menu.

Getting close but no cigar.

here is my nav settings:

Relative to root
+2
self
siblings
decendents
+3

The folloing template is not working:
 <tmpl_if session.var.adminOn>
<tmpl_var controls>
</tmpl_if>

<div id="menu">
<ul id="nav" class="eight">
<li id="nav_home" class="first"><a href="/home">Home</a></li>

<tmpl_loop page_loop>
<tmpl_if page.isViewable>
<li><a <tmpl_if page.newWindow>target="_blank"</tmpl_if> href="<tmpl_var page.url>"><tmpl_var page.menuTitle></a>

<tmpl_if page.hasChild>
  <ul>
   <tmpl_loop page_loop>
<tmpl_if page.isChild>
      <li><a <tmpl_if page.newWindow>target="_blank"</tmpl_if>       href="<tmpl_var page.url>"><tmpl_var page.menuTitle></a>
      </li>
</tmpl_if>
    </tmpl_loop>
  </ul>
</tmpl_if>
</li>
</tmpl_if>
</tmpl_loop>
</ul>
</div>

the html output should be this:

<ul>
  <li>link
     <ul>
         <li>sublink</li>
     </ul>
  </li>
</ul>

 It seems as though the nested loop is not working.
Thanks

--- (Edited on 2/20/2008 2:53 pm [GMT-0600] by ministrycrm) ---



Back to Top
Rate [
|
]
 
 
lrobinson

You could maybe do something like this:

<ul>

  <tmpl_loop page_loop>
    <tmpl_if page.isViewable>
      <tmpl_if page.depthIs2>

        <li><tmpl_var page.menuTitle>

      <tmpl_else>
        <tmpl_if page.depthIs3>
          <ul>
            <li><tmpl_var page.menuTitle></li>
          </ul>

        <tmpl_if page.isRankedLast>
          </li>
        </tmpl_if>

        </tmpl_if>

      </tmpl_if>
    </tmpl_if>

  </tmpl_loop>
</ul>
 

 

I am trying to build a css dropdown menu.

Getting close but no cigar.

here is my nav settings:

Relative to root
+2
self
siblings
decendents
+3

The folloing template is not working:
 <tmpl_if session.var.adminOn>
<tmpl_var controls>
</tmpl_if>

<div id="menu">
<ul id="nav" class="eight">
<li id="nav_home" class="first"><a href="/home">Home</a></li>

<tmpl_loop page_loop>
<tmpl_if page.isViewable>
<li><a <tmpl_if page.newWindow>target="_blank"</tmpl_if> href="<tmpl_var page.url>"><tmpl_var page.menuTitle></a>

<tmpl_if page.hasChild>
  <ul>
   <tmpl_loop page_loop>
<tmpl_if page.isChild>
      <li><a <tmpl_if page.newWindow>target="_blank"</tmpl_if>       href="<tmpl_var page.url>"><tmpl_var page.menuTitle></a>
      </li>
</tmpl_if>
    </tmpl_loop>
  </ul>
</tmpl_if>
</li>
</tmpl_if>
</tmpl_loop>
</ul>
</div>

the html output should be this:

<ul>
  <li>link
     <ul>
         <li>sublink</li>
     </ul>
  </li>
</ul>

 It seems as though the nested loop is not working.
Thanks

--- (Edited on 2/20/2008 2:53 pm [GMT-0600] by ministrycrm) ---

--- (Edited on 2/28/2008 8:47 am [GMT-0600] by lrobinson) ---



Back to Top
Rate [
|
]
 
 
dionak

We had a similar need recently and ended up building and contributing a package for menus (drop and fly-out). You may find this package really helpful, especially in regards to the template.  

Here's the link:

http://www.plainblack.com/user_contributions/user_contributions/packages/drop-and-flyout-navigations

Diona 

----
Knowmad Technologies
http://www.knowmad.com

--- (Edited on 3/6/2008 9:45 am [GMT-0600] by dionak) ---



Back to Top
Rate [
|
]
 
 
rogier

Is this still an issue? If so: try this and please let me know if it works:

<tmpl_loop page_loop>

<tmpl_if __FIRST__>
<ul>
<li>[home link here]</li>
</tmpl_if>

<tmpl_loop page.depthDiff_loop>
</ul>
</li>
</tmpl_loop>

<li><a href="<tmpl_var page.url>"><tmpl_var page.menuTitle></a>

<tmpl_if page.hasViewableChildren>
<ul>
<tmpl_else>
</li>
</tmpl_if>

<tmpl_if __LAST__>
<tmpl_loop page.indent_loop>
</ul>
</li>
</tmpl_loop>
</ul>
</tmpl_if>

</tmpl_loop>

 

Rogier | United Knowledge
www.unitedknowledge.nl · www.webgui-help.nl

--- (Edited on 13-05-2008 12:22 am [GMT+0200] by rogier) ---



Back to Top
Rate [
|
]
 
 

Smoketest For nightly_2008-08-30 by Visitor - Sat @ 01:45am

Re: Config File Changes by pwrightson - Fri @ 04:07pm

Re: IRC Logs by koen - Fri @ 02:08pm

Re: IRC Logs by patspam - Fri @ 02:01pm

Re: IRC Logs by koen - Fri @ 01:42pm

Re: How do I find al my submitted RFE's? by bartjol - Fri @ 01:39pm

Re: IRC Logs by kristi - Fri @ 01:27pm

Re: LastModified question by perlDreamer - Fri @ 12:57pm

Re: How do I find al my submitted RFE's? by bartjol - Fri @ 12:11pm

How do I find al my submitted RFE's? by koen - Fri @ 11:23am

Re: IRC Logs by koen - Fri @ 11:20am

IRC Logs by martink - Fri @ 10:51am

Re: cleaning out the wiki by koen - Fri @ 10:44am

Re: shop in 7.5.21 by kristi - Fri @ 09:03am