Howdy, Stranger!

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

External links in Harlowe

edited June 2015 in Help! with 2.0
I can't seem to be able to add a link to an external site using http://link.com syntax. When I try, the resulting link is dark red and unclickable, the cursor changing to a stop sign when the mouse is over it. HTML hyperlinks (<a href=""></a>) work fine, but look a bit ugly. What can be the problem with external URLs in Twine 2.x links? Any advice would be welcome.

Comments

  • edited June 2015
    .
  • edited June 2015
    (link:"Whatever")[(gotoURL:"http://www.google.com";)]
    

    The links themselves work just fine. Needs the right syntax and you're all set!

    EDIT: no semi-colon needed. It keeps jumping in there somehow.
  • When I use this within twine, it opens the external link in the same window, but there seems to be no way back to the story at the point I left it. Hitting the backspace on my keyboard takes me back to my start screen.

    Am I doing something wrong or does it open a new tab in the browser once it's published?

    Cheers

    GL
  • Sage wrote: »
    (link:"Whatever")[(gotoURL:"http://www.google.com";)]
    

    The links themselves work just fine. Needs the right syntax and you're all set!

    EDIT: no semi-colon needed. It keeps jumping in there somehow.
    Thanks, this works like a charm!
    But, to second G_Lascelle's question, is there a way to make external links open in a new tab so that the reader is not thrown out of the game all of a sudden?
  • edited June 2015
    You can use an a element like the following to open a link in a new window, depending on the Readers web-browser configuration it may open within a new tab instead.
    <a href="http://www.google.com"; target="_blank">Click here</a>
  • Note: If you use GreyElf's idea, it sounds like you will probably want to add some custom CSS to style these to look like others. If I understood you correctly.
  • edited October 2015
    I'm way LTTP on this one, but can you explain how to do the custom CSS to style my links to look like Harlowe?

    I don't know much about html and am woefully inadequate regarding CSS. Specifically, what would the code look like?
  • Oldcastle wrote: »
    but can you explain how to do the custom CSS to style my links to look like Harlowe?
    If you were asking how to style my example then try adding the following to your Story Stylesheet:
    tw-passage a {
    	color: #4169E1;
    	font-weight: 700;
    	text-decoration: none;
    }
    tw-passage a:hover {
    	color: #00bfff;
    }
    
Sign In or Register to comment.