Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7630683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:09:56+00:00 2026-05-31T06:09:56+00:00

In my application I have a header and footer include. In my Application.cfc I’ve

  • 0

In my application I have a header and footer include. In my Application.cfc I’ve set up a function that names my application and sets mapping.

<cfcomponent output="no">
<cfset this.name = "thesitename">
<cfset this.datasource = "thesitedatasource">
<cfset this.rootDir = getDirectoryFromPath(getCurrentTemplatePath()) />
<cfset this.mappings = structNew()>
<cfset this.mappings["/planning"] =  "#this.rootDir#planning/" />
<cfset this.mappings["/images"] = "#this.rootDir#images/" />
<cfset this.mappings["/includes"] = "#this.rootDir#includes/" />
<cfset this.mappings["/js"] = "#this.rootDir#js/" />
<cfset this.mappings["/portfolio"] = "#this.rootDir#portfolio/" />
</cfcomponent>

If I have a page in a subdirectory like this: planning/index.cfm the <cfinclude> can’t locate anything in the images folder when I use the following path: <li class="imagelink"><img src="/images/facebook.png"></li>

Pages in the root directory don’t have a problem.

If I understand correctly, the problem has to do with the mapping doesn’t take place prior to the include being called, or something like that… How do I get the mapped paths to work properly in my include?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:09:57+00:00Added an answer on May 31, 2026 at 6:09 am

    ColdFusion mappings are completely separate from a web server ‘alias’ or ‘virtual directory’. In order for your code to work, you will need to add a web server mapping, ‘alias’ in Apache or ‘virtual directory’ in IIS, named ‘images’ that points to the directory where you keep the images.

    The ‘images’ ColdFusion mapping will only work in ColdFusion – for example, when creating an object, you could use createObject( “component”, “images.image”) (assuming of course that you had a CFC named Image in that diectory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my CodeIgniter application have a common header and footer view, which I include
I have an application layout in my rails app to give a default header/footer
So my setup for my web application is that I have a general header
In my application I have a header (at the top) and a footer(at the
I have a header , listfield and footer in my application's main page. I
Currently, I have an Application which consists of a BasePage which as a header
I have created this report using BIRT and phpjavabridge <?php header(Content-type: application/pdf); header(Content-Disposition: inline;
I have application that makes different queries with different results so the caching in
I have a classic ASP application that I've been constantly trying to modularize. Currently,
I am using PHP and Smarty. I have a simple application that: Shows page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.