Man.. something weird is going on.

Here's an example.

I have a main template file sitting in the webroot. /template.cfm

It's included in every page. The template has two sidebars.. one on
the left side and one on the right side of the website. I have a
folder in root called 'sidebar' and 2 subfolders called 'left' and
'right'.

I call it from the main template with

<cfinclude template="sidebar/right/rightSidebar.cfm">

This works fine.

How within the 'sidebar/right/rightSidebar.cfm' document, I have 2
more includes.

<cfinclude template="/sidebar/right/loginSidebar.cfm">
<cfinclude template="/admin/google/googleAd200x200sb.cfm">

What's weird, is the first include is actually in the same folder of
it's parent include (rightSideBar.cfm). I can remove everything but
the document name, and it still works (as expected). But it works with
the path spelled out as well.

however, the 2nd include throws an error saying it can't be found. I
realize that the cfinclude is being called from a document that is 2
folders deep. However, if I try to escape it using '..' it doesn't
work either. I've tried multiple periods to try and escape back to the
root then give the location.. ie

<cfinclude template="./admin/google/googleAd200x200sb.cfm">
<cfinclude template="../admin/google/googleAd200x200sb.cfm">
<cfinclude template=".../admin/google/googleAd200x200sb.cfm">

And for the life of me I can't get it to find this document, even
though it's there, and if I call it via url from the webroot it finds
it.

www.mysite.com/admin/google/googleAd200x200sb.cfm

Ideas?






Th



On Tue, May 29, 2012 at 11:27 AM, Matthew Woodward
<[email protected]> wrote:
> On Tue, May 29, 2012 at 9:20 AM, Jason King <[email protected]> wrote:
>>
>> Is there a way to define cfincludes to absolute path? I don't want to
>> declare OS path, but I'd like for every include to have the full path
>> starting from the webroot.
>
>
> Just set the stuff that's redundant across multiple include statements to an
> application variable and use that as part of your include.
>
>
> --
> Matthew Woodward
> [email protected]
> http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.
> http://www.gnu.org/philosophy/no-word-attachments.html
>
> --
> online documentation: http://openbd.org/manual/
> http://groups.google.com/group/openbd?hl=en

-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

Reply via email to