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.

General Questions

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

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

Silverstripe + Custom Code restrictions


Reply

3 Posts   1203 Views

Avatar
acefx

31 January 2009 at 3:43am Community Member, 8 Posts

Hi
am am very new to Silverstripe and i have already been working on a special project.
Well all is going well until i was working on building a custom application using php but silverstripe keeps giving me errors and also i do things like document.getElementById() in Javascript and it does not work.

can anyone help me out, even if its a function to show me how to go about it.

NOTE: am still an amateur in PHP so i dont write classes yet.

Thanks

Avatar
dio5

1 February 2009 at 5:53am (Last edited: 1 February 2009 6:01am), Community Member, 501 Posts

I think you'll get more answers if you're a bit more specific about your problem.

Doing document.getElementById() is javascript, I suppose it's for the frontend site?

This should work like any normal site, independent of Silverstripe.

Adding javascript is easy: just put your js file under mysite/javascript and reference it from within the head of your Page.ss in themes/yourtheme/templates/.

(You could also use a requirements statement in your controller (http://doc.silverstripe.com/doku.php?id=requirements) but I don't tend to do that.)

Avatar
acefx

5 February 2009 at 8:53pm Community Member, 8 Posts

Thanks man

I really appriciate this

It worked.