Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

List all File, also PDF, XLS etc. in a Folder

Hi.

I searched the FAQ's and all the site about, how to list files on a page, which aren't Artikles OR HTML-Files.

We have a lot of Documents and Folders:

Companies
  Big.pdf
  Insurances.pdf
  Ohter.xls
  OtherOther.doc
....

How can i make a List of these Files for each folder. Of course it should be made automatically in a Loop.

If i tried the following:
{$foreach x in (folder "Articles")$}
  <A href="{$x.link$}">{$x.filename$}</A><br>
{$next$}


All Articles were Listed, but NOT files with other Extensions like .pdf or .xls etc.

Thanks for your Help and lot of Greatings from Switzerland (!!! No, it's NOT SWEDEN :-))  ...Switzerland, it is there where the real good Choccolat and best Chees come's from or better knowing the Swiss-Army-Knife  :-))    ).

cu. and TNX!

Emilio

Emilio
Tuesday, July 09, 2002

I can't help you with a perfect way of work.

I create an article for each PDF and use the extra fields to put the link in. In the foreach loop, I publish links to articles except if the extra1 field is 'nonblank'. In that case that link will be published on the index-page. The article itself contains only a link.

Adriaan van den Brand
Tuesday, July 09, 2002

Hi Adriaan,

TNX for your workaround. Well, i thougt i could just display the "inner" of a folder like i can with ASP.

Mabe somone else have also an idea or could it be a ENHANCEMENT for CityDesk ?

Just imagine! It would be a cool and very helpfull feature, to display a folder with, lets say about 50 > files for download, because it would save very very much time instead of inserting 50 Links ;-)

What do you think about ?


Greats

Emilio

Emilio Sabatino
Tuesday, July 09, 2002

Sure it is a possible enhancement for Citydesk, like many suggestions that are made already. Also there is nothing wrong with combining the best of all worlds (e.g. Citydesk and ASP or PHP etc.)

If it is a download folder, you may consider using one of many PHP/Perl tools that generate such a file for you.

Adriaan van den Brand
Tuesday, July 09, 2002

I'm looking for similar functionality.  I'd like to dynamically build a list of PDFs but without having to create separate articles for each.

I'd be receptive to an agent that automatically generated the articles if that was the only way to make it happen. 

John Dillon
Thursday, September 25, 2003

*  Recent Topics

*  Fog Creek Home