embedding passage from other section

msh
03 Sept 2015, 06:15
I recently discovered squiffy and i love it! I've been playing around with it, and i was wondering:

Is there an easy way to embed a passage from another section?
Below is some code to display the problem i have, the example below displays null instead of the desired text.

[[section1]]:
{the passage i want to show}

[[section2]]:
Text from next section.

[the passage i want to show]:
this text wil not be displayed


thanks in advance!

Alex
03 Sept 2015, 08:47
Passages only exist inside their section, so there's no way anything in section1 can see any of the passages from section2.

One way you could do this is to put the text you want to be displayed in its own section instead. Then you can embed that section in multiple passages, like this:


[[section1]]:
This is section 1. [[Next]](section2)

{some shared text}

[[section2]]:
This is section 2. [Some passage]

[Some passage]:
{some shared text}

[[some shared text]]:
This is shared text.


You can try it out live on the ScratchPad

msh
03 Sept 2015, 15:20
Thanks for the quick reply. I was afraid i would get that answer.

If i would solve the problem by only using sections, and no passages, would that slow down the code a lot?

I'm asking this because i got a huge amount of passages i would like to embed in different sections. If i change all of these passages into sections, my problem would be solved too..

Alex
04 Sept 2015, 12:04
It shouldn't be a problem, it should still be fast.

msh
04 Sept 2015, 12:23
I'll try it out,

Thanks a lot for your help!