Click here to register.
      
PBWG Banner


     Discuss > Web Design, Templates, and Themes

Trouble with navigation template

User cioscott
Date 8/12/2005 2:51 pm
Views 6767
Rating 23    Rate [
|
]
Previous · Next
User Message
cioscott

The sample menu structure below came from http://www.plainblack.com/etcetera/navigation-quandry.  I too have a similar page layout, and I have been trying to construct a navigation template which produces this nicely nested unordered list, but I have not been able to do so.  Could somebody share their template or provide some hints at what constructs are required in the template?

I am running WG 6.6.3, and my navigation is configured as follows:

  • Starting Point Type: Relative to root
  • Starting Point: /a/ (+1)
  • Relatives to include: Self, Pedigree

Here is the sample menu structure.  (Sorry for the tags, but I still seem to have difficulty in pasting html code into this WG editor.)

<ul>
  <li>Home</li>
  <ul>
    <li>About</li>
    <ul>
      <li>People</li>
      <li>Technology</li>
      <ul>
        <li>PHP</li>
        <li>Perl</li>
      </ul>
    </ul>
    <li>Contact</li>
    <ul>
      <li>Email</li>
      <li>Phone</li>
      <li>Fax</li>
    </ul>
    <li>Products</li>
    <li>Support</li>
    <ul>
      <li>Help Desk</li>
      <li>Knowledge Base</li>
      <li>My Account</li>
    </ul>
  </ul>
</ul>

--- (Edited on 7/19/2005 3:25 pm [GMT-0500] by cioscott) ---



Back to Top
Rate [
|
]
 
 
pwrightson

I am coming into this thread late, but I had a short fix added somewhere between 6.6.0 and 6.6.3 to allow the following Nav template

 

<tmpl_if session.var.adminOn>
    <tmpl_var config.button><br>
</tmpl_if>
<ul>
<tmpl_loop page_loop>
<tmpl_if page.depthDiffIs-1><ul></tmpl_if>
<tmpl_if page.depthDiffIs1></ul></tmpl_if>
<li><a <tmpl_if page.newWindow>target="_blank"</tmpl_if> href="<tmpl_var page.url>">
    <tmpl_if page.isCurrent>
        <span class="selectedMenuItem"><tmpl_var page.menuTitle></span>
    <tmpl_else>
        <tmpl_var page.menuTitle></tmpl_if></a></li>
</tmpl_loop>
</ul>

 

Then I use CSS to "pretty it up".

BTW, I actually use 6.2.11 patched with the fix, so I cannot tell you for sure that this will work; it should in theory! 

Paul 

--- (Edited on 7/21/2005 10:26 am [GMT-0500] by pwrightson) ---



Back to Top
Rate [
|
]
 
 
colink

Won't there be cases where you need to back track 2 levels with </ul> tags?

 

  • Asset 1
  • Asset 2
    • Asset 1a
    • Asset 1b
      • Asset 2a
  • Asset 3

 The transition between 2a and 3 will have a depthDiff of 2, but only 1 ending</ul> tag will be generated.

--- (Edited on 7/21/2005 10:43 am [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 
cioscott

Interesting... I made a modification to the template provided by pwrightson, and I included the page.depthDiff along with the page.menuTitle so that we may see what WG reports as the actual depthDiff.  Below is a copy of my results.  Notice that the numbers produce by page.depthDiff do not correspond to what is evaluated by page.depthDiffIsN.  More bugs I suspect...

Here is the template I used for testing...

<ul>
<tmpl_loop page_loop>
<tmpl_if page.depthDiffIs-1><ul></tmpl_if>
<tmpl_if page.depthDiffIs1></ul></tmpl_if>
<tmpl_if page.depthDiffIs2></ul></ul></tmpl_if>
<tmpl_if page.depthDiffIs3></ul></ul></ul></tmpl_if>
<li><a <tmpl_if page.newWindow>target="_blank"</tmpl_if> href="<tmpl_var page.url>">
    <tmpl_if page.isCurrent>
        <span class="selectedMenuItem"><tmpl_var page.depthDiff>&nbsp;<tmpl_var page.menuTitle></span>
    <tmpl_else>
        <tmpl_var page.depthDiff>&nbsp;<tmpl_var page.menuTitle></tmpl_if></a></li>
</tmpl_loop>
</ul>

And here is the output it produced...

    *  0 Intranet
          o -1 FAQ
          o 0 How To
          o 0 Test
                + -1 HR
                + 0 Product Data
                      # -1 TestHTML
                + 1 Product Entry Form
                + 0 Promotions
                + 0 Go To Ebay

--- (Edited on 7/21/2005 11:07 am [GMT-0500] by cioscott) ---



Back to Top
Rate [
|
]
 
 
colink

Could you please repost this with the depth variable,as well?
--- (Edited on 7/21/2005 11:20 am [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 

Error in log. by pvanthony - Fri @ 12:46pm

Re: Goals by JT - Fri @ 12:31pm

Re: Images in RSS-Syndicated asset by elnino - Fri @ 12:25pm

Re: Password Recovery info wrong by dwittenberg - Fri @ 12:04pm

Re: Password Recovery info wrong by dwittenberg - Fri @ 12:03pm

Re: WebGUI::Crypt by JT - Fri @ 11:56am

Re: Images in RSS-Syndicated asset by ehab - Fri @ 11:52am

Re: Images in RSS-Syndicated asset by elnino - Fri @ 11:47am

Re: Password Recovery info wrong by knowmad - Fri @ 11:18am

Re: Password Recovery info wrong by dwittenberg - Fri @ 11:11am

Re: Password Recovery info wrong by bartjol - Fri @ 10:56am

Password Recovery info wrong by dwittenberg - Fri @ 10:22am

Re: Conventions for German translation by bartjol - Fri @ 07:24am

Smoketest For nightly_2008-10-10 by Visitor - Fri @ 01:55am