We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30176
    • 99 Posts
    I had a comment in a rich text template variable for a right column.
    <!-- Facebook Badge START -->

    It has been there for a long time, and rendered through all the browsers I was checking fine. However, when I upgraded to Firefox 10 all of the sudden this page (resource) did not display correctly. I am not sure how to describe it other than it seemed to break the div containers on the page. Removed it and the page rendered fine. So I thought, I would put the same code in the main resource content of the page just to test it. The page rendered fine there to. It seems that comment code, combined with a template variable and Firefox 10 do not seem compatible. Just wanted to put this out there to let people know.
      "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
      -J.R.R. Tolkien from The Lord of the Rings
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Doesn't seem to do it on any pages I try it on. Same browser. More information would be helpful, such as is the TV used in a template or in a chunk? What is the actual output of the TV (what does a View Source of the rendered page look like)? Is that the default value, or specific to the resource?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 30176
        • 99 Posts
        Susan, it is a chunk on the template with a TV in that chunk. A while back I had the TV right on the template but went to a chunk as I added a phx element.

        The affected part of my template looks like this:
        <div id="extras">
                   <div>{{AjaxSearchMenu}}</div> 
                   <div><p>{{WayfinderRight}}</p></div>
                   <!--   <div id="glance"> <p>[*rightcolumn*]</p></div>  -->
                   <div> {{glance}}</div>
         </div>


        What is happening, I have a comment on my template, which was the code prior to adding the "glance" chunk that replaced it. I should have erased it, but I left it there to remind me what I had originally done. That comment, however, is still rendering the code in "rightcolumn" TV and putting that code in a comment on the page. Not the problem yet, though I guess I am surprised at the TV in the comment still being rendered. When I added the Facebook badge to the template variable later, I added the code Facebook gave me for the badge which included the comment at the beginning and I just left the comment with the code. All of that was then rendered in that comment on the template. So the code was rendered twice: once enclosed in a comment on the template and then the actual rendering in the "glance" chunk that now contains the TV. But the problem seems to be the comment within a comment on the rendered page in Firefox 10: The Facebook Badge comment in the TV within the comment on the template. I took the comment out of the TV and it renders fine in Firefox 10. Up until now I had not had a problem with that code in other browsers.

        I hope that makes sense. That page lost all formatting, but all the other pages with the same template were fine, however, none of those other pages have that comment within a comment as that is the only page that I added the Facebook Badge code to.


          "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
          -J.R.R. Tolkien from The Lord of the Rings
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          From what I understand, Firefox has always been a bit quirky in its handling of comment tags. At one point it would break any use of paired (or more) hyphens. Then it had problems with nested tags. This may be another similar bug (or feature?).

          The first closing comment tag found is presumed to have closed the first comment opening tag. Everything beyond that first closing comment tag will be displayed, including the outer closing comment tag itself. Officially, nested comment tags are not permitted and don't validate, so browsers may or may not handle them in different ways.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30176
            • 99 Posts
            Thank you Susan!
              "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
              -J.R.R. Tolkien from The Lord of the Rings