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.

Archive /

Our old forums are still available as a read-only archive.

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

Scripting in the .ss files

Go to End

2 Posts   1617 Views


28 Posts

14 July 2007 at 8:26am

How can you script in the *.ss files?

What scripting language does silverstripe use.
I thought it was php but I can't get php to
work in the *.ss files.

I tried
<% ... %>
<?php ?> works only for /* */ comments
// comments don't work
echo "hello"; doesn't work

I'd like to change the banner depending on what page is
displayed and putting the banner directly in the page
would limit it to the content section.


Community Member, 201 Posts

14 July 2007 at 1:03pm

Edited: 14/07/2007 1:04pm

Hi Tkop

The SilverStripe template system isn't designed to support embed PHP. Our approach has been to force a clear separation between the storage, logic and presentation layers. Embedding PHP inside the templates blurs the lines between the logic and presentation layers which, architecturally, isn't desirable.

Looking at some of your previous questions, I would suggest you run through the Tutorials this should help answer this and other questions your having.