Howdy, Stranger!

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

Adding variables into HTML

Say I wanted to do
<<set $example = either("cat", "cow", "dog") >> 
<img src = "picture of house" alt="You see a house, with a $example calling in the background">

How can I make it work? And not just for alt text, for anything included within HTML tags. Does it need javascript?

Comments

  • And also including something for each $example is not feasible with the amount of eithers that I'm intending.
  • You're failing to mention the story format you're using again.


    The standard way is, generally, something like the following:
    <<set $example = either("cat", "cow", "dog")>> 
    <<print '<img src = "picture of house" alt="You see a house, with a ' + $example + ' calling in the background">'>>
    
  • Sorry about my dumbass self, still in sugarcane. Thanks!

    I've used this now to make http://philome.la/MazHem_/englishtweet/play have tweetable generated names.

    Though as you can see I did do a bit of a silly thing, clicking "again" with it linked to "Start" broke the tweet code for some reason? So I just linked to the url it was gonna be uploaded as.

    This is sort of a test version for something in the future, it may end up I just move the "restart" text somewhere down.
Sign In or Register to comment.