Jump to content
This topic contains 32 posts with an estimated read time of 15 minutes. A summary containing the most significant posts is available with an estimated read time of 4 minutes.

Featured Replies

  • Community Expert
 

Same steps as above, the JS is:

I think that needs an additional condition to only show for members, doesn’t it?

  • 3 weeks later...
 

Yeah, it's super easy in Invision Community 5. Barely an inconvenience.

The javascript I paste in is this:

<script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
      let newLi = document.createElement("li");
      let newLink = document.createElement("a");
      newLink.href = "#";
      newLink.innerText = "Back to Top";
      newLink.setAttribute( 'style', 'padding: .8em');

      let newIcon = document.createElement("i");
      newIcon.classList.add("fa", "fa-arrow-up");

      newLink.prepend(newIcon);

      newLink.addEventListener("click", function (event) {
          event.preventDefault();
          window.scrollTo({ top: 0, behavior: "smooth" });
      });

      newLi.appendChild(newLink);

      let ul = document.querySelector('nav.ipsBreadcrumb--bottom a[data-action="defaultStream"]').closest("ul");
      if (ul) {
          ul.appendChild(newLi);
      }
  });
</script>

 

Same steps as above, the JS is:

<script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
      let newLi = document.createElement("li");
      let newLink = document.createElement("a");
      newLink.href = ipsSettings.baseURL + 'markallread/?csrfKey=' + ipsSettings.csrfKey;
      newLink.innerText = "Mark Site Read";
      newLink.setAttribute( 'style', 'padding: .8em');

      let newIcon = document.createElement("i");
      newIcon.classList.add("fa", "fa-solid", "fa-eye");

      newLink.prepend(newIcon);
      newLi.appendChild(newLink);

      let ul = document.querySelector('nav.ipsBreadcrumb--bottom a[data-action="defaultStream"]').closest("ul");
      if (ul) {
          ul.appendChild(newLi);
      }
  });
</script>

CleanShot 2025-02-07 at 13.01.51@2x.png

I did it first without recording, then removed it but didn't refresh the page before recording, that's all.

@Matt This then leaves a small blank area where the Text Block is, within the footer. Any way to make that go away?

  • Community Expert
 

@Matt This then leaves a small blank area where the Text Block is, within the footer. Any way to make that go away?

I guessing that nothing should be displayed because the only time that there would be padding or margin is when a style is defined or when the browser has a defined style such as for a div tag. If there is padding or a margin, you could probably target it via a section if or class from that area.

  • Community Expert

You could target it via a section "id" or class selector with css.

 

I guessing that nothing should be displayed because the only time that there would be padding or margin is when a style is defined or when the browser has a defined style such as for a div tag. If there is padding or a margin, you could probably target it via a section if or class from that area.

Thank you. Setting the padding to none got rid of the display.

  • 3 weeks later...

@Matt

Any chance to get this working in mobile version? (Visibility is correctly set for the block in footer)

@abetts

You need to enable Pages module.

Recently Browsing 0

  • No registered users viewing this page.