Howdy, Stranger!

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

Embed Harlowe in HTML page?

edited July 2016 in Help! with 2.0
I have a website with its own navigation bars on the top, right, and bottom sides of the page. I am trying to make a page that is a Harlowe story, but still has the site's navigation bars. We tried putting the Harlowe-generated page in an <iframe>, but the story contained links to third-party sites (using (goto-url:)), and those links loaded within the iframe (we wanted them to replace the whole page). We tried copying the <head> and <body> from the Harlowe-generated page into a new <head> and <div>, but then when twine navigated to any passage (including the start), the twine DOM elements became direct children of <html>, which made it harder to style things predictably. Can you think of good workarounds for either of these? Ideally without forking twine2/harlowe.

Comments

  • First embed your Story HTML file using an iFrame and then use either of the following linking methods within a passage to replace the parent page.

    note: Have to use a quote tag because the code tag adds an extra semi-colon to URLs.
    The following link uses a target attribute to replace the parent window with Google but it may not work on all browsers.

    <a target="_parent" href="http://google.com/">click me</a>

    The following link uses Javascript to replace the parent window with Google.

    (link: "click me")[
    <script>window.parent.location.href = "http://google.com/";</script>;
    ]
  • Thank you! That worked for us!
Sign In or Register to comment.