Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current folder name

Status
Not open for further replies.

neofactor

Technical User
Jul 30, 2000
194
0
0
US
How do you get the current folder name for a given page?

Currently I do this:
---------------------------------------------------
<CFSET FullPathNoFile = GetDirectoryFromPath(ExpandPath(&quot;*.*&quot;))>
<CFSet CurrentFolderNameOnly = LCase(ListLast(FullPathNoFile,&quot;\&quot;))>
---------------------------------------------------

Is there a faster or better way?

Thanks,
David
 
You might look at the cgi variables
#cgi.script_name# and #cgi.path_translated#.

chau
 
LCase(ListLast(getdirectoryfrompath(getbasetemplatepath()),&quot;\&quot;))

This will do it in one line.
I would not rely on cgi vars for this.

maybe a shorter way? dunno, but this works very reliably for me.



 
Thanks...

yes one line is good....

But I define a whole list of veriables...
FullPathNoFile
FullPathWithFile
FullURLWithFile

You get the idea...

ok.. looks like I have the best / only way already...

thought there was a hidden command (Undocumented)

Thanks again for the support.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top