Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-55336

Any custom HTML at end of body causes duplicate footer image

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 6.7.1, 6.8.0, 7.19.0
    • Themes / Theming

      Summary

      When inserting HTML page elements into the "At end of the body" field of the Custom HTML admin page, the footer image is duplicated.

      Environment

      • Reproduced in Chrome 65.0.3325.181 and Firefox 59.0.2

      Steps to Reproduce

      1. Go to the Custom HTML admin page
      2. Insert an HTML element onto the page in the At end of the BODY field:
        <h1>test</h1>
        

      Expected Results

      A header with the word "test" will appear at the end of the page with no other elements after it.

      Actual Results

      The header is shown, and the footer "Atlassian" logo is duplicated below it.

      Notes

      This happens for adding any HTML page element (even just plain text with no html tags), but does not appear to affect scripts entirely encapsulated in a <script> tag.

      Workaround

      Remove duplicate image (preferred)

      You can remove the duplicate logo with the following code. This workaround most directly resolves the root cause:

      <script type="text/javascript"> $("#footer-logo").hide();</script>
      Add whatever you want to show in the footer here.
      You should see all this text, and only one logo.
      

       

      Scripts

      If the entire custom HTML is a script, be sure all the code is inside <script></script> tags.

      HTML Elements

      If you do have HTML elements to add to the footer, this issue will not happen if the content is added through a script. You can use the following templates to add HTML elements to the end of the page with jQuery (note: these have the possibility of having unintended visual side-effects, and are suggested here only if the "Remove duplicate image" workaround does not work for you):

      Insert above Atlassian logo (may cause duplicate logos if any links are used)
      <script>
        const textToAdd = `
          <p>Here is some HTML that will show at the bottom of the page.</p>
          <p>No duplicate footer here!</p>
        `;
        $('#footer-logo').prepend(textToAdd);
      </script>
      
      Insert below Atlassian logo
       
      <script type="text/javascript"> 
        let textToAdd = ` 
          <p>Here is some HTML that will show at the bottom of the page.</p> 
          <p>No duplicate footer here!</p> 
        `; 
        $('body').append(textToAdd); 
      </script> 
      

        1. duplicate-footer.png
          33 kB
          Zak Laughton

              Unassigned Unassigned
              zlaughton Zak Laughton
              Votes:
              10 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated: