This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Can't remove prototype from <head>

Notes and reports about symfony 1.0.x stable

Can't remove prototype from <head>

by adriani » Tue Aug 12, 2008 3:52 pm

Hi guys,

I have a small issue with Prototype.
I have removed it from view.yml from the module, and from view.yml from the application, and from the settings.yml, but it still shows up in the <head> tags when accessing a page.
I need to do this for using FancyUpload.

Any help will be appreciated.

Thanks a lot in advance.
adriani
Junior Member
 
Posts: 7
Joined: Tue Jul 22, 2008 9:32 am
Location: Iasi

Re: Can't remove prototype from <head>

by wissl » Tue Aug 12, 2008 6:22 pm

Do you use the Javascript helper?

I am not sure about that, but some time ago I read somewhere, that the helper includes prototype if not happened before, because the helper relies on it.
wissl
Faithful Member
 
Posts: 461
Joined: Sun Mar 02, 2008 2:34 pm
Location: Germany

Re: Can't remove prototype from <head>

by reedcat » Wed Jun 23, 2010 7:47 pm

And still, is there any way to disable symfony from automatically adding prototype.js into the header? I am already adding it via absolute URL to our CDN so it is already defined once in the header. Symfony then throws it in there again...

view.yml:

Code: Select all
  javascripts:    ['http://cdn.mydomain.com/sf/prototype/js/prototype.js']


header:

Code: Select all
<script type="text/javascript" src="http://cdn.mydomain.com/sf/prototype/js/prototype.js"></script>
<script type="text/javascript" src="/sf/prototype/js/prototype.js"></script>


Any idea on how to work this around?
reedcat
Junior Member
 
Posts: 28
Joined: Fri Apr 21, 2006 8:35 am

Re: Can't remove prototype from <head>

by reedcat » Sat Apr 09, 2011 5:33 pm

It is probably funny that almost 3 later and I still have this issue. :cry:

Any thoughts on how to kill the beast?
reedcat
Junior Member
 
Posts: 28
Joined: Fri Apr 21, 2006 8:35 am

Re: Can't remove prototype from <head>

by wissl » Sat Apr 09, 2011 8:27 pm

So I believe you are using hte javascript helper somewhere, which includes the prototype lib from a default folder. You can specify the folder by adding a config to settings.yml like this:
Code: Select all
prototype_web_dir: /newfolder

(see http://www.symfony-project.org/book/1_0 ... figuration for that)

Maybe you can set the folder including your domain?
wissl
Faithful Member
 
Posts: 461
Joined: Sun Mar 02, 2008 2:34 pm
Location: Germany

Re: Can't remove prototype from <head>

by reedcat » Mon Apr 11, 2011 11:00 pm

It appears symfony requires a file path for that attribute. If I use a URL then the value is ignored and the default location ('/sf/prototype/js') is used.
reedcat
Junior Member
 
Posts: 28
Joined: Fri Apr 21, 2006 8:35 am