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.

Template Questions /

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

template comments shown in html source in live mode in 2.3.3?

Go to End

4 Posts   3969 Views


Community Member, 18 Posts

17 September 2009 at 6:45am

I just noticed that a live site I just put up shows comments in the source code like the one below:

<!-- include /home/www/ -->

I was very happy when those comments were first introduced, but usually they would dissappear in live mode.

I'm defining the live mode in my _ss_environment.php file like this:

I also tried setting the live mode like this in my _config.php file:

Finally I checked by echoing environment type out (echo Director::get_environment_type();), which always shows 'live'.

You can see the live site at

Did anyone have similar issues with 2.3.3?


Forum Moderator, 5523 Posts

17 September 2009 at 6:36pm

Try var_dump'ing out SSViewer::get_source_file_comments() to see what that says. You can always disable it by setting SSViewer::set_source_file_comments(false);


Community Member, 18 Posts

17 September 2009 at 7:32pm

Hi Willr,
thanks for your reply!
I don't know if it is something special to my current Silverstripe setup, but I am able to set source file comments off with SSViewer::set_source_file_comments(false);
Unfortunately the comments are still shown.

The live environment is definitely set, as my javascript and css files are being combined.

I'm running the following Silverstripe setup: cms jsparty sapphire

It is not a big issue for me if it is only my current setup, but maybe there is a bug somewhere?

Fred Condo

Community Member, 29 Posts

29 September 2009 at 9:58am

Edited: 29/09/2009 10:26am

I am seeing the same problem. This may be a regression in 2.3.3.

Update: it is a regression. I filed this: