I have no idea why I'm stuck on this, need a nudge in right direction. I am building a set of admin functin pages to allow an admin to create directories, upload and administer files, and delete files and directories. It's the delete function I'm having trouble with, or rather perhaps the way(s) I've tried to implement.
I have a root directory: /usr/local/apache/htdocs/projects. I do NOT want the root directory to display on the delete page. The admin will be able to create subdirectories under ../projects: ../subdir1 ../subdir2 etc and files will be uploaded into those directories. Here is the target I'm trying to hit: When a directory contains files, I want to display directories like this (with the root directory hidden): subdir1/subsubdir1/subsubsubdir1 subdir1/subsubdir1/subsubsubdir2 subdir1/subsubdir1/subsubsubdir3 QUESTION: How do I display the path minus the root directory using "template speak?" I've read the Template::Plugin::Directories and Template::Plugin::Files pages, and run myself in circles trying to use things like [% file.rel( item.name )%] which gets me part way there, except it shows an ugly string of ../../../ before the initial subdir. I want to display any files beneath the directory most recently mentioned on the page wrapped in a form which would allow a file delete: <FORM METHOD="POST" ACTION="tt2/docmgr/deldir"> [% file.name %] <INPUT TYPE="SUBMIT" VALUE="DELETE"> </FORM> Ideally, once a directory is empty of files, I'd like that empty directory now to be wrapped in a form allowing a rmdir. Anyone? /dennis --------------------------------------------------------------------------- Office phone: 817-762-8304 --------------------------------------------------------------------------- You can teach cats tricks, but you have to make them think it was their idea. _______________________________________________ templates mailing list [EMAIL PROTECTED] http://www.template-toolkit.org/mailman/listinfo/templates
