Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Pulling child folders/files

Hi,

Is there a way to get a list of second level folders/files from "thisFolder"?

Imagine this menu structure:

Products
--Product 1
--Product 2
--Product 3
----Product 3 details
Sales
--Contact sales
--Get a quote
Contact
--General

Now, I want that every page inside /Products and its subfolders show a common sub-navigation, i.e., in Product 3 details:

Product 1 | Product 2 | Product 3

and the same in each product page. And similar on other sections (sales, contact...).

So far, I've come up with these options:

1. Create a template for each main section.
2. Create a file in each section which has the sub-navigation menu, and include it in the template.
3. Get a list of child articles from the main folders(/Products, /Sales, etc), not including sub folders.

The third option would be desirable, but I don't think CityDesk supports something like this:

thisFolder.root.name (root not being "/", but "/Products", etc.

The second option appears to be the way to go, but I can't figure how to do it... Mainly because I want to be able to add subsections as I please (as articles) and that the nav updates itself. If I add additional files to handle sub-navigation, I have to edit those manually...

And the first one is the less desirable.

Looking forward to your insight...

- Ivan V.

Ivan Vega R.
Wednesday, March 10, 2004

Ivan,

For maximum automation, you have to give up the subfolders. CityDesk doesn't allow you to go up and down the folder hierarchy in this way, so my idea is to remove the folders - or at least move the index pages for each product into the product folder.

That is, these articles inside products:
  index
  product1
  product2
  product3

Then you can have the Nav built with a fornext, in (thisFolder) & not (filename "index"). You could also have subfolders for each product, containing images or other information if required.

I'm not sure if you can have the subfolders without giving up copious amounts of convenience. I've thought about it, but all my ideas require features that CityDesk doesn't currently support!

Joel Goodwin
Wednesday, March 10, 2004

Ivan

You may find a little of what you're looking for here:
http://www.fogcreek.com/CityDesk/kb/howto/Breadcrumbs.html

It uses some of the principles discussed by Joel (above) in rooting through nested folders - using an index topic in each folder to hold the information on the folder.

Perpetual Newbie II
Thursday, March 11, 2004

Thank you for your comments.

I've given it a little thought and I think I'll use a server side script to do it exactly the way I want.

Ivan Vega R.
Thursday, March 11, 2004

What i did was following: Put all articles (including the "head" article into the same folder.
Then use the keywords to distinguish between head and subarticles.

So on the main menu i publish only the head articles, using a check for a specific keyword.

On the sub menu i publish only the sub articles leaving the head article out with a keyword check.

Ewout de Graaf
Friday, March 26, 2004

*  Recent Topics

*  Fog Creek Home