Link buttons to open-up in a popup

It would be nice if you add the functionality to the link button to open the linked page in a pop-up.

image

2 Likes

I was just about to post something about this and would like to add to it. Please also allow the ability to choose subpages for links as well across the board.

@Moe @tim.young

Status of this request, is it in the roadmap and if yes, when can it be expected?

you can do this with javascript hack.

@christopher93 You have some code you may want to share?

add css class “popup-link-btn” in linkButton

Add HTML component on page and paste this code.

<div id="linkPopup" class="modal fade" tabindex="-1">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button class="close" type="button" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
             <iframe id="newIframe" width="100%" height="650px" frameborder="0"></iframe>
      </div>
      <div class="modal-footer">
        <button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

Paste this JS code in Javascript

$(document).ready(function(){
    $("body").find(".popup-link-btn").each(function(){
        $(this).unbind("click").on("click", function(event){
            event.preventDefault();
            event.stopPropagation();
            let src = location.origin + location.pathname + $(this).attr("href");
            console.log(src)
            $('#newIframe').attr('src', src);
            $("#linkPopup").modal()
            return false;
        });
    });
});
2 Likes

Thanks @christopher93

Just FYI, when I tested I had to change this line:

to:

let src = location.origin + $(this).attr("href");

To get this to work.

Also, works best if this other page is not inside a layout, otherwise you’ll have the menu and layout settings applied again.

on my side this line

let src = location.origin + $(this).attr("href");

create this kind of URL which is incorrect.
https://abc.tadabase.io#!/toogle-switch