• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Absolute Links & Mappings

Participant ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

I am trying to setup a new site that is using absolute links.

Every page I run gives me this type of error below (Could not find the included template /includes/..........) See below for full error

How do I correct this?

In the CFadmin > Server Settings > Mappings or

IIS mappings

or

some code in application.cfc

Could not find the included template /includes/head.cfm.

Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc.
Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible.

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

LATEST

Not sure what to answer here that hasn't already been said - the answer is in the text you posted:

Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc.

Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible.

If you use CFINCLUDE then you will use a relative path (i.e. my_include.cfm)

Otherwise use a mapping in coldfusion to point to the include and reference that mapping. So in Coldfusion admin you would set a the logical path to "/my_includes" and the directory path to "C:/cf/my_includes/"

Then you can set the CFINCLUDE to be "/my_includes/my_include.cfm"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation