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:

show all problem (1997) Re:What file? (1997) Mac Vs WindowsNT (1997) Using Applescript to process WebCatalog functions (1998) [SearchString] problem with [search] context (1997) emailer on Windows Beta 18 (1997) WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (1997) WebCat b13 CGI -shownext- (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) Max Record length restated as maybe bug (1997) [WebDNA] Sorry WebDNA server not running - September 2019 Edition (2019) [WebDNA] An unknown error occured // Deadlock avoided (2011) Using webcat to roll apache logs (2002) Force a search at the default.tmpl page? (1997) NTbeta18 corrupted? (1997) Need relative path explanation (1997) Hiding HTML and page breaks (1997) Webcat2, WebCommerce, Mod 10 etc. (1997) Emailer Problem (1998) OT: [WAY IN RIGHT FIELD SOMEWHERE] Spam Filters (2005)