Re: Nested ListFiles

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19438
interpreted = N
texte = >How can nest 3 levels of [listfiles] within a single page?Yes, but you should probably try a different technique called recursion. Basically you use an [include] file that [include]s itself whenever it runs into a folder. You pass the foldername as a parameter to the [include], and at each level of depth the foldername you pass in gets longer and longer.I don't have time to test one right now, but the idea is like this:-- DisplayFolders.inc -- [listfiles [startfolder]] [ShowIf [isFolder]=T] [include file=DisplayFolders.inc&startfolder=[startfolder]/[filename]] [/ShowIf] [/listfiles]Notice how the interior loop uses [include] to do it all over again, but with a built-up path that leads one deeper in the hierarchy.Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Nested ListFiles (Pat McCormick 1998)
  2. Re: Nested ListFiles (PCS Technical Support 1998)
>How can nest 3 levels of [listfiles] within a single page?Yes, but you should probably try a different technique called recursion. Basically you use an [include] file that [include]s itself whenever it runs into a folder. You pass the foldername as a parameter to the [include], and at each level of depth the foldername you pass in gets longer and longer.I don't have time to test one right now, but the idea is like this:-- DisplayFolders.inc -- [listfiles [startfolder]] [ShowIf [isFolder]=T] [include file=DisplayFolders.inc&startfolder=[startfolder]/[filename]] [/ShowIf] [/listfiles]Notice how the interior loop uses [include] to do it all over again, but with a built-up path that leads one deeper in the hierarchy.Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ PCS Technical Support

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:

b18 problem on NT 4.0 (1997) pop up menu's (1998) Problem: 3.0 doesn't update carts (1997) Removing and Reinstalling Typhoon (2000) Multiple prices (1997) On a related topic (2006) Configuring E-mail (1997) Frames and WebCat (1997) WebCat2b12 CGI Mac - [shownext] problem (1997) [delete] problem (1997) WebCat2b13MacPlugIn - [include] (1997) Need help with Shipping/Price discounts (1998) WebCatalog 3.0.8 serial problem on MacOS (2000) Random Links (2004) [FoundItems] solved - thanks (1997) Webdna sends your serial number on Internet (2003) Calculating multiple shipping... (1997) [search] and [shownext] Problem (2000) Text data with spaces in them... (1997) Problems passing [SKU] with $Replace in 2.0 (1997)