Howdy, Stranger!

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

Remove "previous" link?

Hi,

I know how to use Macros in order to replace links with content But is there a way to remove a link that has already been included in a passage with a link that comes after it? For instance, if I have two links like this:
  • Link 1
  • Link 2
Can I click on Link 2 and remove Link 1?

Thanks!
Tim

Comments

  • You could link to an otherwise identical passage with those things changed, removing the transitions in that passage to avoid the whole page flashing. Could probably wrap the changed content in a <span> tag with some custom css transitions if you wanted to have it not abruptly switch.
  • Yes, I can do that, of course Ok, so heres a funny notion:

    I gave myself the challenge of completing an entire RPG-style game in 8 passages. Totally out of the realm of thinking rationally. So, with this being said ;)

    Could I accomplish this within a single passage?

    T.
  • You can use my method with a single passage but the transitions may look wonky.

    You can make content conditional on number of passage visits with an "if" macro and referencing history, and then link to the passage with the link. So in the passage name "Recurring" you would write a link that linked back to [[Recurring]].

    Every time you click that link, the passage reloads, and the text will show different things if you have it all wrapped up in tags like <<if visited ("Recurring") gt 1>> (SugarCube example), as each reload increases the history counter by 1.

    You can try and wrap this alternate text in css <span> to give them alternate transitions.


    You can use this method to write an entire game in a single passage if you're insane.
  • Claretta wrote:

    You can use this method to write an entire game in a single passage if you're insane.


    Haha. Dont tempt me. :p

    Ok, I get what youre saying, though I think I can use that.

    Thank you!
    Tim
  • Instead of referencing the history count you could also use the link to set a variable and then make the page content dependent on what variable was set.
  • Actually, thats what I ended up doing. Im having issues getting it to work, though:

    On the previous passage I set the variable to 0. Most of the passage content loads when the variable is set to 0 and works fine. When I click the link in question, it sets the variable to 1 (which is working fine). But, for some reason, when the passage reloads, it is not loading the content that should load when the variable is set to 1, but rather I just get a blank page.

    Scratch that Its working. What isnt working is that when I loop pack to the passage, its not reloading the page. Therefore, while the variable is changing, the items that contain the previous variable arent being removed.

    Any ideas?


    Arg. Gotta love misplaced brackets. ;) Sorry for the noise.
Sign In or Register to comment.