0 votes
by (1.1k points)
edited by

Just a question, ideas on how to make a list is in one passage interact to open one page of descriptive in another.


A list of people.
<<for _i; _people range $peoplehere>>
    _people [[interage]]

Directing to a new page where there will be total information about the person and interactions.

But I was not sure how to build such a structure.

As a tradition, I would like ideas in JS as well. [[interage]] It is not just a descriptive page but also leads to other pages of the the person chosen with interactions.

1 Answer

0 votes
by (159k points)

I will assume that your $peoplehere variable equals something like the following...

<<set $peoplehere to ["Jane", "John", "Betty", "Bob"]>>

If I understand your question correctly you want to show a list of people names, each with an interage link that dynamically sends the reader to a Passage specifically associated with that person.

eg. Jane's interage link would send the reader to a Jane related passage, John's interage link would send the reader to a John related passage, and so forth.

I will assume that the person related passages are named something like

Jane interactions
John interactions
Betty interactions
Bob interactions

The following example should do what you want

A list of people.
<<for _person range $peoplehere>>
    <br>_person <<link "interage" `_person + " interactions"`>><</link>>

1. I fixed the syntax errors in your <<for>> macro usage.

2. I replaced your Markup based link with the <<link>> macro so I could use backquote expression to dynamically generate the name of the Target Passage (based on the person's name and a " interactions" string).

3. I used a <<nobr>> macro combined with a HTML <br> element to better control where line-breaks were being inserted in the output.