Strange inconsistantcy in variable

I’m finding a VERY strange result with a variable, where the value of the variable is messed up in preview but is fine when published.
(note: I’ve removed the angle braces around the image tags so they will show up here)
Variable Name: $ARUPConsult_img
Expected value of variable: “…/web_resources/CLT/images”

Normal usage (we use this convention all over our site and it works everywhere else):

img src="$ARUPConsult_img/plusik.gif" /

Result in preview:

img src="../web_resources/CLT../web_resources/CLT/images/plusik.gif" /

Then if I remove the trailing slash:

img src="$ARUPConsult_imgplusik.gif" /

Result in preview:

img src="../web_resources/CLT/imagesplusik.gif" /

I have verified that there is no javascript in play by using a network sniffer to inspect the actual packets… so whatever is happening, its not browser related, its related to the trailing slash. Its like its trying to remove one of the folders from the path… but then it displays it once without the trailing folder, and again with… I’m totally lost. I’ve even tried setting the slash character as a variable called slash, then changing the template to look like:

img src="${ARUPConsult_img}${slash}plusik.gif" /

but it still messes up the path.

Any tips would be appreciated.

-Jason

Have you tried to use your variable with curly braces? (This is the formal way to use a variable in velocity)
ie:


img src="${ARUPConsult_img}/plusik.gif" 

if you add a ! after the $ then you won’t get a big error if ARUPConsult_img variable doesn’t exist…


img src="$!{ARUPConsult_img}/plusik.gif"