Jump to content

Insert link next to standard download button in gallery report


Recommended Posts

  • 4 years later...

Hi wimtracking2,

You could add this code snippet to the footer in the results section of your DataPage:

if(typeof linkURL=='undefined') {
const linkURL = 'https://www.google.com/'
const linkText = 'Some text'
const linkTemplate = `<li><a href=${linkURL} class="cbResultSetDownloadLink" id='appendedLink'>${linkText}</a></li>`
if(document.querySelector('.cbResultSetActionsContainerCellspacing')!=null && document.querySelector('#appendedLink')==null) {
document.querySelector('.cbResultSetActionsContainerCellspacing li:nth-last-child(1)').insertAdjacentHTML('afterend', linkTemplate)
}}

Just substitute linkURL and linkText with values you need.

Hope this helps

Link to comment
Share on other sites

Hello! You can add the custom link in your Header using the 'a href' tag and add some CSS to it. 

<a href="https://www.google.com" style="position:relative; left:260px; z-index: 1; top:25px;">Google</a>

Just modify the value of left and top property based on your desired position on the page. Here is the sample result.

image.png.796ff694472ef80f7ce253f8394da565.png

Link to comment
Share on other sites

  • 2 weeks later...

hi @wimtracking2,

you can use the following script and paste this on the Footer of your Report DataPage:

<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {

var child = document.querySelector("li[id^='DataDownloadButton']");
var parent = child.parentElement;

 var a = document.createElement('a');
      var linkText = document.createTextNode("my title text");
      a.appendChild(linkText);
      a.title = "my title text";
      a.href = "http://example.com";

parent.parentNode.appendChild(a);

});
</script>

 

Simply change the "http://example.com" to the page where you want to bring your users when they click the link

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...