Include Javascript from outside Template / Override Folder

Include Javascript from outside Template / Override Folder

Wednesday 15 April 2009 12:41:44 pm - 2 replies

Modified on Wednesday 15 April 2009 1:04:02 pm by Michael Fürst

Author Message

Noicokuna Niemoge

Thursday 16 April 2009 3:38:19 am

Why an inclusion of script type="text/javascript" doesn't work if, judging from the file name, it's a jquery fuction/plugin?

Maybe check if the file is correctly loaded? Is the path OK? Test the hard-coded path to be sure.

Also, because of rewrite engine switched on (and because I can't find any better solution), I tend to include js files from folders outside eZ structure. Or, in eZ root directory, create any category, put there js files and put a htaccess in it like this:

RewriteEngine Off
DirectoryIndex index.html

<FilesMatch "\.(js)$">
order allow,deny
allow from all
</FilesMatch>

I know it's not elegant, but as I asked in these forums for a good way to include js files and external php scripts, nobody answered... (and I both don't have time and are not good enough to make eZ extensions for trivial little scripts)

Shiki soku ze ku...

Yannick Komotir

Thursday 16 April 2009 3:50:22 am

Hi you can generate your js in /design/mydesign/templates/ like a .tpl and include this like you talk

{include uri="design:link.tpl"}

--
Sorry for my poor english^^

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.