Dreamweaver+coldfusion 和相对路径
如何设置 Coldfusion 文件/模板的路径,以便模板引用的文件在 DW 中正确显示?
假设我有这样的设置,
/file.cfm
/doc/file2.cfm
/include/header.cfm
/css/style.css
/js/mooQuery.js
如果我引用 header.cfm 中相对于 root 的 css+js 文件,它可以在服务器上运行,但不能在 DW 中运行。
如果我引用 header.cfm 中相对于 /include/ 的 css+js 文件,它可以在 DW 上运行,但不能在服务器上运行。
虽然我理解这一点并且如果 DW 不使用 css 样式也不是世界末日,但我希望能够让它在 /doc/file2.cfm
中工作。
我使用基本标签取得了一些成功,但我需要将其定位到服务器,因此对本地驱动器(DW)没有帮助
我想使用 Coldfusion 设置一些非常基本的模板并使其与 Dreamweaver 一起使用。您可能认为 Adobe 的不同团队会互相交谈一下。
How do I set the path in for coldfusion file/template so that files referenced by the template show up properly in DW?
let's say I have this setup
/file.cfm
/doc/file2.cfm
/include/header.cfm
/css/style.css
/js/mooQuery.js
If I reference the css+js files in header.cfm relative to root, it works on server, but not in DW.
If I reference the css+js files in header.cfm relative to /include/, it works on DW, but not on the server.
while I understand this and it's not the end of the world if DW doesn't use the css styling, I would like to be able to have it working from /doc/file2.cfm
as-well.
I have some mild success using the base tag, but I need to target it for the server, so no help on the local drive (DW)
I would like to set up some very basic templating with coldfusion and have it work with dreamweaver. You'd think the different teams at Adobe would talk among themselves a bit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很可能您的实时版本位于网络根目录中,但您的本地版本不是。 Dreamweaver 的模板系统可以处理此问题,但如果您尝试通过 ColdFusion 文件使用模板系统,那么最简单的方法是简单地使用配置文件来管理两个环境之间不同的值。
在您的应用程序文件夹中设置这样的文件夹/文件结构...
live 和 dev 文件夹中的配置文件将具有类似于... 的代码
,并且
可以根据需要随着时间的推移添加其他结构键。
然后将环境的适当配置文件复制到父配置文件夹中,并将其包含在您的应用程序或索引文件中...
您的链接将变为...
Most likely your live version is in a webroot but your local version is not. Dreamweaver's template system can deal with this but if you are trying to use a template system through ColdFusion files then the easiest approach is to simply use config files to manage values that are different between the two environments.
Setup a folder/file structure like this in your app folder...
The config files in live and dev folders will have code similar to...
and
Additional struct keys can be added over time as necessary.
Then copy the appropriate config file for the environment into the parent config folder, and include it in your application or index file...
Your links then become...