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

Remove template comments

Go to End

7 Posts   2336 Views


Community Member, 197 Posts

9 May 2009 at 12:55am

How do I remove template comments from the generated HTLM?

<!-- template E:/wamp/www/ss/themes/simple/templates/ -->

<!-- end template E:/wamp/www/ss/themes/simple/templates/ -->

What should I put in to prevent these comments from being displayed


Community Member, 904 Posts

9 May 2009 at 1:03am

As far as I know these comments only show in Dev mode. Eg. when you run your site on localhost.


Community Member, 197 Posts

2 June 2009 at 9:28pm

These codes are causing me grief even in Dev mode on localhost.

IE7 does NOT like comments before the document type definition. It causes the whole page to be rendered incorrectly!

How can I get rid of these comments?

<!-- template /home/mysite/html/ss/themes/atom/templates/ -->
<!-- include /home/mysite/html/ss/themes/atom/templates/Includes/ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">


Community Member, 215 Posts

2 June 2009 at 9:49pm

Yea as banal said, these comments only occur when the site is in Dev mode - once you put the site into live mode then the comments disappear :)


Community Member, 197 Posts

2 June 2009 at 10:07pm

How can I make them go away even in dev mode? They are breaking my site so I can't even test it!


Community Member, 904 Posts

3 June 2009 at 12:15am

Maybe you should not put include statements before the <!DOCTYPE
Since you'll never want anything before that doctype tag, you shouldn't add an include there to begin with!

If I'm making false assumptions, and you're not including anything before the doctype tag, please share your template code with us...
I for one haven't encountered this problem yet.

Ben Gribaudo

Community Member, 181 Posts

3 June 2009 at 12:28am




in your _config.php file should turn these comments off.