Template Path Function Gotchas!

I was talking with Brian Rinaldi the other day about the latest release of his Illudium code generator and the new CF Template support he added. While trying to run the generator for the first time using the CF Templates that Brian includes, I was greeted by an error popup instead of the nicely formatted goodness that I was used to seeing.

It turns out that when using the CF templates, Brian writes some files to a ‘temp’ directory and then <cfincludes> those files into the generation process. Unfortunately on my Macbook Pro, I kept getting an error saying that Illudium couldnt find my temp directory. So I dug into the Finder and found the temp directory not where Brian was expecting it but several levels deeper and sure enough, there were some temp files in there from the generator.

After going back and forth with Brian for several hours and trying different things we narrowed the issue down to the source of the problem. It turns out that Luis Majano was having the same problem I was having but Brian was not. The only thing that Luis and I had in common on our setup that Brian had differently was that we were both running multi-server installs of 7.0.2 and Brian was running the stand-alone install.

It seems that if you run the following functions in a method thats called from another CFC such as a service layer on a stand-alone install you get 2 different paths, but on the multi-server install, they both return the same path.


getBaseTemplatePath()
getCurrentTemplatePath()

Not really sure if thats the intended behavior for the multi-server install or not but it just seems strange that the results would be different in the two environments.

Im curious to see if any other Mac users have run into this issue or if any Mac users have run this successfully with no errors on a multi-server install.

3 thoughts on “Template Path Function Gotchas!”

  1. That is exactly what I was getting on the MAC. However, on standard install for the PC was the other scenario. I have not played around with it much after Brian gave me the fix.

Leave a Reply

Your email address will not be published. Required fields are marked *


*