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:

Archive /

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

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

Comments in the templates

Go to End

2 Posts   1443 Views


Community Member, 105 Posts

28 February 2008 at 1:37pm

I am sure this is obvious and I am sure my question makes all experienced SS developers and users groan, but

Can I put comments in a template so that the next time I read the template I can understand the thinking behind the code, but it doesn't get translated for the browser? And if so, what does those comments look like?


Forum Moderator, 5523 Posts

28 February 2008 at 8:26pm

you have to use normal html comments I guess for your templates <!-- this is a comment --> if you don't want it to show up in the browsers view source you could create a method in Page called Comment so you would have

function Comment() {
return false

then in the template you could use <% if Comment %><!-- Write all your notes in here --><% end_if %>