Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

New Versions of Prototype & Scriptaculous

Go to End

3 Posts   1080 Views


Community Member, 70 Posts

27 April 2009 at 1:00pm

Hi folks

I have been trying out a new autocomplete field in a SilverStripe site I have been working on.
My main difficulty was finding a decent implementation that loaded fairly fast. I did find one ( that I am pleased with, but I am still in difficulties as it requires more recent versions of Prototype ( & Scriptaculous (1.8.1) than those that come with SilverStripe 2.3.1.

These new versions are not backwardly compatible with core SilverStripe code (messes up the CMS greatly).

I tried installing the newer libraries separately, and calling them directly from the pages I require them for, but this is not working 100%.

Essentially, the issue is that I would need to ensure the libraries in the jsparty folder only load in the CMS backend, and my new libraries only load in the front end.

This is tricky to do, but not impossible. My question is though:
1) Is it practical? Will I be forever firefighting problems?

2) Is there a more elegant way to do this?




Forum Moderator, 224 Posts

27 April 2009 at 1:10pm

I would

Requirements::javascript( ... my new files ....)
Requirements::block( .... outdated files .....)

make sure this codes only runs when the field shows and not in other circumstances.

I think that should work.

However, if possible, I would look at something that uses jQuery as this is the preferred JS library.


Community Member, 70 Posts

28 April 2009 at 10:23pm

Thanks Nicolaas, yes, I had those in, but I was finding that the script was intermittently breaking nonetheless.

I think the reason for this was the login page (which is used in the front end) was calling the jsparty versions and this was causing things to get complicated!

I have since switched to a jquery solution as you suggested. No sense in swimming against the tide!

There is a working demo of it up at: (the location field on the form to the right)

I will publish a code example when I have it working better (code isn't 100% reusable yet).