Obviously, I am doing something wrong, but I don’t see it. According to a thread I saw, I needed to specify the complete path to various resources such as CSS. In order to get
<link rel="stylesheet" href="http://127.0.0.1:8500/owners/includes/css/changent.css" />
rendered, I need to code
yet, it seems I should be able to code
In my environments.xml I have the environment mapping
When I run my code with the ApplicationHome variable, I get a message stating Variable APPLICATIONHOME is undefined. And, the error page shows that I am in the development environment.
Application Name: owners (environment=development)
What am I missing?
Unfortunately, that produced incorrect results as well:
<link rel="stylesheet" href="http://127.0.0.1:8500/owners/index.cfm/http://127/0/0/1:8500/owners/includes/css/changent/css" />
Instead, this worked:
Thanks for putting me on the right path!
I just tend to use:
and then I can use relative urls for images / css / js etc.
This is on ColdBox 3, so I’m not sure if it works on older versions.
Yes, but then this implies changing my actions from “doSomething” to “index.cfm//doSomething”? Not a huge loss to be sure, just a bit of crankiness on my part as this is not how it works out of the box. However, I am leaning towards setting the base. Do you know of any implications of which I should be aware by doing so? I have to admit that I have not used base very often.
For ColdBox event links I use:
#event.buildLink( ‘handler/action’ )#
ColdBox turns that into a full url with the index.cfm part for me. I can also edit one file if I have a rewrite engine and my links will be generated without the index.cfm if I want.
For everything else (js/images/css) I just use relative links from the base href.
I don’t know of any implications, but I’ve always done it like that so can’t really compare with doing it another way (sorry - that’s not very helpful!)