Open link to new tab

revel911
revel911
edited October 2014 in Feature Requests
When you set up a link on the wiki, can it open to a new tab? This would help greatly rather than having to go back and forth between the opened info and the new page.

Comments

  • MachineGunHarry
    MachineGunHarry
    Posts: 115
    Right click on it. Select "Open in New Tab". Also you can, I believe, set that as your default with your browser. This way ALL hyperlinks are opened in a new tab.

    But this is not your true question. You would like the CSS for making all of YOUR links in your wiki open in a separate tab...don't know if that would be totally awesome...or get annoying after awhile. Sort of the same issue behind adding music to your wiki pages. Eventually, it would seem like you cut off some of you diversity. But hey what the heck! So does anyone know the CSS to control every hyperlink in our wikis?
  • Bondoid
    Bondoid
    Posts: 35
    This should be possible with html using the Target attribute...

    ex.
    link

    But I can't get it working on Obsidian Portal.
  • cgregory
    cgregory
    Posts: 780
    I've tried a number of other work arounds not using the _blank target and they all fail on Obsidian portal.

    Current Campaign: "Devils and Dilettantes":https://devils-and-dilettantes.obsidianportal.com - A Pathfinder Campaign
    Campaign in planning: "Deus Ex Machina":https://deusex.obsidianportal.com/wikis/home-page -A Shadowrun Campaign

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • mfmonk
    mfmonk
    Posts: 3
    Anyone figure out how to do this yet? I have external links I would like to open in new tabs. Internal links (such as wiki pages) I would like to keep in the same tab.
  • Unknown
    edited January 2015
    Well, while there still seems to be no way to open an external link in a new tab, you could at least automatically mark all external links so a person on the site knows clicking it will lead them away. Assuming you do all of your internal links as relative links then this would work great:

    a[href^="http://"]:after, a[href^="https://"]:after {
    content: " (external)";
    }

    Again, for this to work you will need to make sure all internal links are relative, for example:

    Text

    OR

    "Text":/wikis/main-page

    If you include full URLs on your internal links then this method would mislabel those. Also note that this isn't perfect since we don't have control over how all the links that pop up onto our pages are displayed (without a bit of extra CSS work to redo said links, but even that may not work so well). This will result in the tag potentially popping up in undesired locations on your page. I would recommend testing it if you are considering using it by slipping it in and quickly navigating and reviewing some of your pages and such to see if the spots it pops up are ok to you.

    A better way to approach this, as a result, would be for you to include the target="_blank" on any links you are going to deem as external (and you may have done this already trying to get it to work or hoping it will eventually work). Once you have that on the desired links you could then add this to your CSS:

    a[target=_blank]:after {
    content: " (external)";
    }

    That should style only links with the target="_blank" attribute on them to include the (external) tag after the text.
    Post edited by Unknown User on
Sign In or Register to comment.

April 2024
Season of Strife

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions