Solved

Remove template name from GetCurrentTemplatePath()

Posted on 2006-07-13
7
258 Views
Last Modified: 2013-12-24
How can I show just the path to the template without the index.cfm?
0
Comment
Question by:Brian Coughter
7 Comments
 
LVL 13

Expert Comment

by:usachrisk1983
Comment Utility
If you're looking for the Physical Path, use:

<cfset variables.templateFolder = ListDeleteAt(cgi.cf_template_path,listlen(cgi.cf_template_path,'\'),'\')>
(change shashes if on non-Windows box)

If you're looking for the web path, use:
<cfset variables.urlDirectory = ListDeleteAt(cgi.script_name,listlen(cgi.script_name,'/'),'/')>
0
 
LVL 13

Expert Comment

by:usachrisk1983
Comment Utility
Ooops, didn't see the title.  If you're using GetCurrentTemplatePath(), then do:

<cfset variables.templateFolder = ListDeleteAt(GetCurrentTemplatePath(),listlen(GetCurrentTemplatePath(),'\'),'\')>
0
 
LVL 9

Expert Comment

by:73Spyder
Comment Utility

Not sure if this is would work the same, but in BlueDragon, we have a cgi var called cgi.cf_template_path
If you have a cgi var that is the same, the code below would work with the var new_path being the path you want


<cfset page_name = ListLast("#cgi.cf_template_path#", "\")>
<cfset temp_len = len(#page_name#)>
<cfset whole_len = len(#cgi.cf_template_path#)>
<cfset new_len = whole_len - temp_len>
<cfset new_path = left(#cgi.cf_template_path#, #new_len#)>
0
Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

 
LVL 9

Expert Comment

by:73Spyder
Comment Utility
Or.... you could just folloe usachrisk1983    post.


did not see it when I posted
0
 
LVL 9

Expert Comment

by:73Spyder
Comment Utility
Or follow even.  It helps to be able to spell.
0
 
LVL 5

Accepted Solution

by:
mrigsby earned 500 total points
Comment Utility
If you looking to just return the path to the current templates directory I always just use #GetDirectoryFromPath(GetCurrentTemplatePath())# Seems a whole lot easier to me.
0
 

Author Comment

by:Brian Coughter
Comment Utility
Thanks.  That was the easy way I was looking for.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now