[rt-users] Making Attachments Open in a New Window

Thomas Sibley trs at bestpractical.com
Thu Dec 6 13:44:57 EST 2012


On 12/06/2012 07:39 AM, Daniel Mayer wrote:
> Hello,
> 
> I have recently installed and begun configuring RT 4.0.7.  However, try
> as I might, I have not yet figured out how to get attachments to open in
> a new window (or tab).  I have followed another article (from around
> 2004) that has you modify the “ShowAttachment” and “Show Transactions”
> (actually now appears to be called “ShowTransactionAttachment” but it
> does not appear that this works.
> 
> Does anyone have any ideas?

This is pretty simple with a bit of javascript using jQuery.  Try the
following in local/html/Callbacks/NewWindow/Elements/Header/Head:

    <script type="text/javascript">
    jQuery(function(){
      jQuery(".ticket-info-attachments a, .downloadattachment a")
        .attr("target","_new")
    });
    </script>

then clear your mason cache and restart your webserver.

Thomas



More information about the rt-users mailing list