Ticket Suggestions = New Tab

9 Comments

  • Nicole - Community Manager
    Comment actions Permalink

    Hey Ryan - 

    Just to make sure I understand your question properly, you mean that you want the links in the suggestions box to open a new window when clicked, is that correct? 

    0
  • Paul
    Comment actions Permalink

    Hi Nicole,

    I am also assuming that's what Ryan means. It would be incredibly nice for us to be able to do the same. Hope there's a way to make this happen.

    Cheers.

    0
  • Ryan Sanders
    Comment actions Permalink

    Yes! (Missed the reply by a few days / months).

    When folks click on suggestions in the tickets, it essentially steals the tab and they have to go back I believe, to continue with the ticket completion. Be nice if this actually sent them to a new tab, which they could leave open or close, without affecting the ticket.

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Hey Ryan and Paul - 

    I picked some Zendeskian brains, and they suggested the target=blank code in the JS. I'm not sure why that part isn't working; hopefully one of our resident JS experts in the Community can jump in and help troubleshoot from here. 

    EDITED TO ADD: 

    You could also post this as a feature request in the Product Feedback topic, as I suspect many users would like to see this as a native functionality. 

    0
  • Paul
    Comment actions Permalink

    Hi Nicole,

    I have tried using JS, but I am unfortunately not an expert. This is what I have done, hopefully, someone at Zendesk or some other kind soul can explain what I have done wrong.

    My code (within the "script.js" file) is the following:

    $(".form .suggestion-list li a:visited").click(function(){
    window.open(url);
    });

    I have also tried with (url, '_Blank'). I have also tried with a number of different Classes, but these are the ones I find when I inspect the specific links within our Guide:

    I hope someone can take a look.

    Cheers

    0
  • Jessie Schutz
    Comment actions Permalink

    Hey Paul!

    I'm going to check with our Community Moderators to see if someone can look through this code with you. Stand by!

    0
  • David
    Comment actions Permalink

    That would be great Jessie, I agree that this would be a great idea.

    0
  • David
    Comment actions Permalink

    Hi All,

    The following code works well for me:

     

    //makes Suggested Article links open in new tab
    $("#request_subject").on("change", function() {

    var links = document.querySelectorAll("div.searchbox-suggestions a");

    links.forEach(link => {
    link.setAttribute('target', '_blank');
    }) });

     

    Where "request_subject" is the ID of the Subject field (in my theme, based on Copenhagen).

    0
  • Jessie Schutz
    Comment actions Permalink

    Thanks for sharing what you figured out, David!

    0

Please sign in to leave a comment.

Powered by Zendesk