Enter subfolders and get file-listings (2. try)
Hi! I Apologize if this one has shown up on the list already (I sent a mail about 10 hours ago ago and I see nothing) Now to my question... I wonder how I can get into subfolders and display the content therein. I have this DTML method: <!--#in "objectValues(['Folder'])"--> <IMG SRC="<!--#var icon-->"> <A HREF="/some/place/show_files?folder_id=<!--#var id-->"><!--#var title--></A><BR> <!--#/in--> Pressing the link on a folders title will bring on folder_id to the show_files DTML method. This is ok, but how can I get into the folder with id=folder_id, so that I can display the files therein? I tried: <!--#in "objectValues(['Folder'])"--> <!--#if "id==folder_id"--> #this one doesn't work - why? <!--#in "objectValues(['File'])"--> <!--#var id--> <!--#/in--> <!--#/if--> <!--#/in--> And: <!--#call "_.getattr(PARENTS[0],folder_id)"--> <!--#in "objectValues(['File'])"--> <!--#var id--> <!--#/in--> This one displays nothing - why? Please tell me the correct way to handle this problem. Sture Lygren
On Mon, 3 May 1999, Sture Lygren wrote:
Pressing the link on a folders title will bring on folder_id to the show_files DTML method. This is ok, but how can I get into the folder with id=folder_id, so that I can display the files therein?
I tried:
Try: <!--#in "_.getitem(folder_id,0)"--> Blah blah <!--#/in--> This assumes that the folder in question is contained by the present object (folder) or a container of the present object (some higher folder), whis is what it looks like you're trying to do. Mike. -- --- | Mike Pelletier Work: 519-746-1607 /opeware! | Software Developer Home: 519-725-7710 --- | mike@zopeware.com Fax: 519-746-7566 http://www.zopeware.com | Zopeware is not endorsed by Digital Creations
Sorry, I just read closer, and what you want is more like... <!--#with "_.getitem(folder_id,0)"--> <!--#in "objectValues(['File'])"--> <!--#var id--> <!--#/in--> <!--#/with--> Mike. -- --- | Mike Pelletier Work: 519-746-1607 /opeware! | Software Developer Home: 519-725-7710 --- | mike@zopeware.com Fax: 519-746-7566 http://www.zopeware.com | Zopeware is not endorsed by Digital Creations
On Mon, 3 May 1999, Sture Lygren wrote:
Hi!
Hi Sture - I have not read your original posting so please ignore me if I am totally of topic.
<!--#in "objectValues(['Folder'])"--> <IMG SRC="<!--#var icon-->"> <A HREF="/some/place/show_files?folder_id=<!--#var id-->"><!--#var title--></A><BR> <!--#/in--> Pressing the link on a folders title will bring on folder_id to the show_files DTML method. This is ok, but how can I get into the folder with id=folder_id, so that I can display the files therein?
I tried:
<!--#in "objectValues(['Folder'])"--> <!--#if "id==folder_id"--> #this one doesn't work - why? <!--#in "objectValues(['File'])"--> <!--#var id--> <!--#/in--> <!--#/if--> <!--#/in-->
You could have a DTML Method in a top level directory that takes care of the listing of Files. Something like (called show_files): <!--#in "objectValues(['File'])"--> <!--#var id--> <!--#/in--> then your selection DTML Method can be: <!--#in "objectValues(['Folder'])"--> <IMG SRC="<!--#var icon-->"> <A HREF="<!--# var id -->/show_files"><!--#var title--></A><BR> <!--#/in--> I believe it should work Pavlos
- Messages deleted - Thanks a lot both of you! The solutions worked out just nicely, but I had to stick to Pavlos way because that was the only one I managed to get a 'delete files' method working from. Sture
participants (4)
-
Mike Pelletier -
Pavlos Christoforou -
raver@box.dust.za.net -
Sture Lygren