To display a link you could use either the markup link or the <<link>> macro.
(warning: If you use the markup link then Twine 2 will incorrectly create a new passage titled whatever your URL is, you need to delete this new passage. note: Using TWEE notation, line starting with two colons represents a new passage, text following the two colons is the new passage's title.)
Hate to be dense, but I plugged that into my stylesheet and it didn't do anything. (And then I spent a fair amt of time trying to figure out other ways to make it work.)
Is there another way to do that? Preferably in the style-sheet, since I know how to get to that? Thanks so much -- this is the last thing I need to do before I can make my game live.
greyelf - I am having trouble replicating what you have shown above in Twine 2.1.2 with Sugarcube 2.18 running on a Mac. Using the <<link (macro as you show) and ended with <</link>> the error message " Error: the passage "http://google.com/" does not exit " pops up. Just wondering if there is a syntax change for 2.18?
Second, the error messages are really hard to see - where should the css changes for the debug messages be made to enable better viewing?
Never mind on the question above about using <<link macro. I accomplished the linking I wanted by putting in another passage the URL using Javascript. I linked then from a passage that had javascriptLink in it and I made a passage called javascriptLink containing only <<script>>
window.open("https://www.google.com"
<</script>>
That opened a new window when click google in the twine passage leaving the twine window intact.
Never mind on the question above about using <<link macro. I accomplished the linking I wanted by putting in another passage the URL using Javascript. I linked then from a passage that had javascriptLink in it and I made a passage called javascriptLink containing only <<script>>
window.open("https://www.google.com"
<</script>>
That opened a new window when click google in the twine passage leaving the twine window intact.
greyelf - I am having trouble replicating what you have shown above in Twine 2.1.2 with Sugarcube 2.18 running on a Mac. Using the <<link (macro as you show) and ended with <</link>> the error message " Error: the passage "http://google.com/" does not exit " pops up. Just wondering if there is a syntax change for 2.18?
No change. Neither the <<link>> nor <<button>> macros have ever supported external links.
Just wondering if there is a syntax change for 2.18?
The 2.x <<link>> macro documentation makes no reference to supporting external URLs so I can only guess that it doesn't now, and my tests confirm that guess.
I agree with @Chapel that using a markup-based link would be a better solution than the <<script>> macro based one you are using.
Comments
To display a link you could use either the markup link or the <<link>> macro.
(warning: If you use the markup link then Twine 2 will incorrectly create a new passage titled whatever your URL is, you need to delete this new passage.
note: Using TWEE notation, line starting with two colons represents a new passage, text following the two colons is the new passage's title.)
Is there another way to do that? Preferably in the style-sheet, since I know how to get to that? Thanks so much -- this is the last thing I need to do before I can make my game live.
1. Create a new passage titled StoryCaption
2. Add to the contents of your new StoryCaption passage a link to the external site.
You can either use a markup link like the following: Or you can use the <<link>> macro: 3. Test your story and you should see a link within the side-bar that points to the external site.
Thank you so much!!!!
Second, the error messages are really hard to see - where should the css changes for the debug messages be made to enable better viewing?
Thanks
window.open("https://www.google.com"
<</script>>
That opened a new window when click google in the twine passage leaving the twine window intact.
Why not just ?
Doing something wildly overcomplicated. You really don't need to do that to open an external link.
Your two simple options are are using a wiki link or a <<link>> wrapping a <<script>> to call window.open().
I agree with @Chapel that using a markup-based link would be a better solution than the <<script>> macro based one you are using.