• Resolved geckoroutes

    (@geckoroutes)


    Hello,

    I would like to add the tag “target=”_blank” to all my links in the tables. Tried to add this tag with a search & replace tool in the SQL database, but for some reason this doesn’t work.

    Is is possible to add a specific code somewhere in the funtions.php file to open all links from the table in a new tab?

    Would be amazing if this is possible!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Adding target="_blank" should work, normally.
    What exactly have you tried for the search/replace? Note that you’d have to insert this as

    target=\"_blank\"
    

    with escaped quotation marks, as the TablePress data is stored in the JSON format, where " have a special meaning.

    Regards,
    Tobias

    Thread Starter geckoroutes

    (@geckoroutes)

    Thanks for your quick response Tobias.

    I wasn’t aware that I couldn’t just use the code target=\"_blank\"

    Looks like we are one step further. However, I still don’t see any successful changes after I made the following action in the “Better Search & Replace tool”.

    Search for:
    API_B2B_19088_00001″>Check
    Repalce with:
    API_B2B_19088_00001″ target=\”_blank\” rel=\”nofollow noopener noreferrer\”>Check

    I’m searching in the following 3 databases:

      wp_options
      wp_postmeta
      wp_posts
    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    you are very close! ?? You’ll also have to escape the other quotation marks, and make sure to use the “upright” ones from the keyboard (") and not the “curly” ones ():
    Search for

    API_B2B_19088_00001">Check
    

    and replace with

    API_B2B_19088_00001" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Check
    

    Regards,
    Tobias

    Thread Starter geckoroutes

    (@geckoroutes)

    The search for
    API_B2B_19088_00001">Check
    didn’t give me any results, but when I changed it to
    API_B2B_19088_00001\">Check it found many.

    However, after replacing the code I get the following error:
    Attention: The internal data of table “manila_to_boracay_overview” is corrupted!

    Luckily I could recover the table again by reversing the replace.

    Any idea what is still wrong with this code?

    API_B2B_19088_00001″ target=\”_blank\” rel=\”nofollow noopener noreferrer\”>Check

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    please try exactly with the replacement code from my previous reply:

    API_B2B_19088_00001" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Check
    

    You must also escape the first quotation mark and use the correct upright quotation marks!

    Regards,
    Tobias

    Thread Starter geckoroutes

    (@geckoroutes)

    Sorry I copied the wrong code in this reply, but I used exactly your code in the searh&replace tool.

    Also tried it one more time, but it brakes the code, resulting in an error.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    argh, it looks like I also made a typo in my suggested code… The first " also needs a \ in front of it, i.e.

    API_B2B_19088_00001\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Check
    

    Can you please try again with that?
    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Opening link in table in new tab’ is closed to new replies.