3+ Levels of Navigation

This WebDNA talk-list message is from

2006


It keeps the original formatting.
numero = 67812
interpreted = N
texte = Hi Thought I'd better ask this while there are still some people here, and sorry for anyone willing to help as it's a bit involved. For years now I have been using the same basic method for creating my dynamic site navigation, it has always had a problem that I've known about but managed to work around - until now! When I create a site with 3 or more levels of nav then I have problems keeping the nav tree open. A crappy demo site is here http://cms.asylumweb.net. If you click on "Root Level Page" then "A second Level Page" so far so good but if you click on the third level page the nav closes. Basically I use a slight variation on the original sitebuilder code to create the navigation from a database. The page database is set up with the following variables... PageIDPageNameRootLevelRankRelated... and some others The PageID is just an ascending number, PageName is what it is, RootLevel is just a flag to say the page is in the root level of nav, Rank is there for sort order and Related is used if the page is a subsection of another page, it stores the PageID of the parent page. I am also trying to keep the url's as clean as poss so would prefer not to be passing any variables. Does anyone know how I could modify the following code to get it to work or alternatively what method do you guys use, I would be happy to start again with it just not sure the best logic to work too. I use the following code to make the nav bar, I've also put this online at the demo site in case the email screws it up. [!] ******************** Nav Loop *********************** [/!] [function name=NavigationLoop] [showif [ROOTLEVEL]=M] [text]myMenu=[Middle StartAfter=/&EndBefore=.][thisURL][/middle] [/text] [/showif]  [showif [ROOTLEVEL]=] [search db=admin/MyData.DB&eqPAGENAMEdatarq=[PAGENAME]] [founditems][text]myMenu=[lookup db=admin/ MyData.DB&lookinfield=PAGEID&value=[related]&returnfield=PAGENAME][/ text][/founditems] [/search] [/showif]  [search db=admin/-Pages.db&eqMAINNAVdatarq=T&eqRELATEDdatarq= [PAGEID]&RANKtype=number&asRANKsort=1] [founditems] [text]NumSub=[search db=admin/MyData.DB&eqRELATEDdatarq= [PAGEID]][numfound][/search][/text] [text]HasSub=[showif [NumSub]=0]F[/showif][showif [NumSub]>0]T [/showif][/text] [showif [indent]=1][/showif] [showif [indent]>1][/showif] [showif [myMenu]=[PAGENAME]] [showif [HasSub]=T] [NavigationLoop indent=[math][indent]+1[/math]] [/showif] [/showif] [/founditems] [/search] [/function] [!] ***************************************************** [/!] [showif [ROOTLEVEL]=M] [text]myMenu=[Middle StartAfter=/&EndBefore=.][thisURL][/middle][/ text] [/showif] [showif [ROOTLEVEL]=] [search db=admin/MyData.DB&eqPAGENAMEdatarq=[PAGENAME]] [founditems] [text]myMenu=[lookup db=admin/ MyData.DB&lookinfield=PAGEID&value=[related]&returnfield=PAGENAME][/ text] [/founditems] [/search] [/showif] [search db=admin/ MyData.DB&eqMAINNAVdatarq=T&eqROOTLEVELdatarq=M&RANKtype=number&asRANKso rt=1] [founditems] [text]NumSub=[search db=admin/MyData.DB&eqRELATEDdatarq=[PAGEID]] [numfound][/search][/text] [text]HasSub=[showif [NumSub]=0]F[/showif][showif [NumSub]>0]T[/ showif][/text] [!][/!] [showif [myMenu]=[PAGENAME]][showif [HasSub]=T][NavigationLoop indent=1&MenuIndex=[index]][/showif][/showif] [/founditems] [/search] Told you it was a bit involved! Thanks for any help ======================================== Steve Craig - Asylum Interactive Ltd Tel +44 1330 860550 Fax +44 1330 860880 ======================================== http://www.asylumweb.com Email: steve@asylumweb.com Skype: s.craig - iChat: steve.craig ======================================== ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
Hi Thought I'd better ask this while there are still some people here, and sorry for anyone willing to help as it's a bit involved. For years now I have been using the same basic method for creating my dynamic site navigation, it has always had a problem that I've known about but managed to work around - until now! When I create a site with 3 or more levels of nav then I have problems keeping the nav tree open. A crappy demo site is here http://cms.asylumweb.net. If you click on "Root Level Page" then "A second Level Page" so far so good but if you click on the third level page the nav closes. Basically I use a slight variation on the original sitebuilder code to create the navigation from a database. The page database is set up with the following variables... PageIDPageNameRootLevelRankRelated... and some others The PageID is just an ascending number, PageName is what it is, RootLevel is just a flag to say the page is in the root level of nav, Rank is there for sort order and Related is used if the page is a subsection of another page, it stores the PageID of the parent page. I am also trying to keep the url's as clean as poss so would prefer not to be passing any variables. Does anyone know how I could modify the following code to get it to work or alternatively what method do you guys use, I would be happy to start again with it just not sure the best logic to work too. I use the following code to make the nav bar, I've also put this online at the demo site in case the email screws it up. [!] ******************** Nav Loop *********************** [/!] [function name=NavigationLoop] [showif [ROOTLEVEL]=M] [text]myMenu=[Middle StartAfter=/&EndBefore=.][thisurl][/middle] [/text] [/showif]  [showif [ROOTLEVEL]=] [search db=admin/MyData.DB&eqPAGENAMEdatarq=[PAGENAME]] [founditems][text]myMenu=[lookup db=admin/ MyData.DB&lookinfield=PAGEID&value=[related]&returnfield=PAGENAME][/ text][/founditems] [/search] [/showif]  [search db=admin/-Pages.db&eqMAINNAVdatarq=T&eqRELATEDdatarq= [PAGEID]&RANKtype=number&asRANKsort=1] [founditems] [text]NumSub=[search db=admin/MyData.DB&eqRELATEDdatarq= [PAGEID]][numfound][/search][/text] [text]HasSub=[showif [NumSub]=0]F[/showif][showif [NumSub]>0]T [/showif][/text] [showif [indent]=1][/showif] [showif [indent]>1][/showif] [showif [myMenu]=[PAGENAME]] [showif [HasSub]=T] [NavigationLoop indent=[math][indent]+1[/math]] [/showif] [/showif] [/founditems] [/search] [/function] [!] ***************************************************** [/!] [showif [ROOTLEVEL]=M] [text]myMenu=[Middle StartAfter=/&EndBefore=.][thisurl][/middle][/ text] [/showif] [showif [ROOTLEVEL]=] [search db=admin/MyData.DB&eqPAGENAMEdatarq=[PAGENAME]] [founditems] [text]myMenu=[lookup db=admin/ MyData.DB&lookinfield=PAGEID&value=[related]&returnfield=PAGENAME][/ text] [/founditems] [/search] [/showif] [search db=admin/ MyData.DB&eqMAINNAVdatarq=T&eqROOTLEVELdatarq=M&RANKtype=number&asRANKso rt=1] [founditems] [text]NumSub=[search db=admin/MyData.DB&eqRELATEDdatarq=[PAGEID]] [numfound][/search][/text] [text]HasSub=[showif [NumSub]=0]F[/showif][showif [NumSub]>0]T[/ showif][/text] [!][/!] [showif [myMenu]=[PAGENAME]][showif [HasSub]=T][NavigationLoop indent=1&MenuIndex=[index]][/showif][/showif] [/founditems] [/search] Told you it was a bit involved! Thanks for any help ======================================== Steve Craig - Asylum Interactive Ltd Tel +44 1330 860550 Fax +44 1330 860880 ======================================== http://www.asylumweb.com Email: steve@asylumweb.com Skype: s.craig - iChat: steve.craig ======================================== ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Steve Craig

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Problem (1997) WebTEN vs webSTAR (1998) [append] (1998) Slightly [OT] - Finding host names (1999) CC Merchant suggestions?? (1997) Merchant account (1998) [OT] Any perl gurus out there? (2006) more info on [setlineitems] (1997) Practice runs ? (1997) Moment of Thanks (1997) SERIAL NUMBER PROBLEM *AGAIN*!!! (1998) [SearchString] usage (1997) Affiliate Marketing Question #2 (1998) Max Record length restated as maybe bug (1997) [ot] Still Interested In Acquiring Hosting Companies (2006) SiteEdit Pro Update Announcement (1997) Password Generator (2004) WebCat2b12 CGI Mac - [shownext] problem (1997) How to add product size choices to form? (1997) Formvariable won't update (1999)