找不到包含的模板

时间:2011-10-07 15:16:44

标签: coldfusion coldfusion-9 cfadmin

当我想运行idnex.cfm时,出现错误“无法找到包含的模板”。 我应该使用CF管理映射,但在不同的文件中有很多这样的错误。 那么,是否有更简单的方法来解决问题?

Full error message:
Could not find the included template spiderBlock.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. 

1 个答案:

答案 0 :(得分:1)

该错误还应告诉您无法找到的WHICH模板,包括CF正在查找的路径。那个位置CF的文件正在寻找吗?我怀疑不是。

如果您首先向我们提供完整的错误消息,我们可以通过合作对此做出明智的评论。

正如其他人所说,有一些方法可以在包含模板中引用包含文件:相对于它自己的位置,绝对来自CF根,或绝对来自已解析的映射。因此,您可能还需要检查映射(将在CFAdmin或Application.cfc中定义)。