Forums / Developer / external javascript file fails to execute eZ-code

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

external javascript file fails to execute eZ-code

Author Message

Richard Stronkman

Thursday 24 February 2005 2:14:42 pm

When I place the following code in my template file, it works fine:

<script>
var test = "{'test.jpg'|ezimage(no)}";
document.write("test:" + test);
</script>

It outputs:
<b>design/mysite/images/test.jpg</b>

But when I place the code (between the script tags) in an external js-file and include the javascript file in my template, the output is:

<b>"{'test.jpg'|ezimage(no)}"</b>

I have tried several alternatives:
- single quotes, double quotes, no quotes

But whatever I tried, the url of my image file was not returned.

Can you help me pleaze!

Best regards

Richard Stronkman

Eirik Alfstad Johansen

Thursday 24 February 2005 11:11:43 pm

Hi Richard,

My guess is that, if you want the template code in your js file to be processed, you need to put the code in a separate tpl file instead, and include it the normal way you would an external tmpl file.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/