Jump to:

1155 Posts in 2568 Topics by 408 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » #2.3rc3 generating html comments...

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1 2
Go to End
Author Topic: 3103 Views
  • patte
    Avatar
    Community Member
    63 Posts

    #2.3rc3 generating html comments... Link to this post

    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

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: #2.3rc3 generating html comments... Link to this post

    Add:

    SSViewer::set_source_file_comments(false);

    to mysite/_config.php or disable dev mode.

  • patte
    Avatar
    Community Member
    63 Posts

    Re: #2.3rc3 generating html comments... Link to this post

    Thanks a lot!

  • patte
    Avatar
    Community Member
    63 Posts

    Re: #2.3rc3 generating html comments... Link to this post

    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

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: #2.3rc3 generating html comments... Link to this post

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

  • patte
    Avatar
    Community Member
    63 Posts

    Re: #2.3rc3 generating html comments... Link to this post

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

    thanks!

  • blueskies
    Avatar
    Community Member
    42 Posts

    Re: #2.3rc3 generating html comments... Link to this post

    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.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: #2.3rc3 generating html comments... Link to this post

    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

    3103 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.