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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

#2.3rc3 generating html comments...


Go to End
Reply


12 Posts   3218 Views

Avatar
patte

Community Member, 63 Posts

11 February 2009 at 9:56pm

Hi,

after upgrading to #rc3 I got a lot of those html comments within the source...

<!-- include ... --> <!-- end include -->
<!-- template ... --><!-- end template -->

How to remove this?

thanks much!
patte

Avatar
simon_w

Forum Moderator, 474 Posts

11 February 2009 at 10:02pm

Edited: 11/02/2009 10:03pm

Add:

SSViewer::set_source_file_comments(false);

to mysite/_config.php or disable dev mode.

Avatar
patte

Community Member, 63 Posts

11 February 2009 at 10:09pm

Thanks a lot!

Avatar
patte

Community Member, 63 Posts

11 February 2009 at 10:13pm

Hm.. I tried to use SSViewer::set_source_file_comments(false); with no success. I also commented out

Director::set_dev_servers(array(
   'localhost',
   '127.0.0.1',
));

but those comments still resists. Any idea?

Thanks

Patte

Avatar
simon_w

Forum Moderator, 474 Posts

11 February 2009 at 10:15pm

Are you flushing your template cache by adding ?flush=all to the end of the URL?

Avatar
patte

Community Member, 63 Posts

11 February 2009 at 10:17pm

ah! I was so irritated about those comments i forgot to flush ;-) No comments any more ;-)

thanks!

Avatar
blueskies

Community Member, 42 Posts

10 March 2009 at 10:56pm

Aaaaaaah! Finally!!

It has just cost me 5 hours to see why a sliced html page (XHTML 1.1) implemented in SS templates went horribly wrong in IE and fine in Firefox. I couldn't find anything wrong in the html, couldn't see a difference in the css (html exactly identical to ss templates), I went through css and html line-by-line.... and yet divs were all over the place in ie....

It took a long long while before I figured out these comments were there and needed to turn off. Comments cannot be placed before the DOCTYPE declaration in HTML because it makes IE go into quirksmode and everything may go awry, see http://www.google.nl/search?q=html+placing+comments+before+doctype

Please, this "feature" really needs to be turned off by default in future releases, because this causes very unexpected behaviour.

Avatar
Ingo

Forum Moderator, 801 Posts

15 March 2009 at 7:32am

Sorry this caused you so much debugging grief... I've opened a ticket asking for opinions about turning this "feature" off by default: http://open.silverstripe.com/ticket/3726

Go to Top