hi, all !
Is it possible for a passage tagged as a “header” or “footer” to update a hook located in the “main” passage ?
I use Twine 2.3.5 and Harlowe 3.1.0.
Thanks in advance.
hi, all !
I will assume that when you say “main” passage you mean the passage of your project that is first shown to the Reader, it will be the passage in your project that has an small White Rocket on a Green Circle icon in the top left corner of it.
The contents of all header tagged passages is process before that of the Passage that is about to be shown to the Reader, often known as the ‘current’ Passage. The contents of all footer tagged passages is processed after that of the ‘current’ passage.
The hook you target with a Revision macro like (append:), (prepend:), and (replace:) needs to be defined before the macro is called.
This means that a Revision macro call made within a footer tagged passage can target a hook defined in the ‘current’ passage (or in your case the “main” passage), but not by a Revision macro call made in a header tagged passage.
The following simple three passage test demonstrates the above.
1: Place the following within your project’s start passage.
2: Place the following within a header tagged passage.
(append: ?header)[From header]
3: Place the following within a footer tagged passage.
(append: ?footer)[From footer]
When you view the project within your web-browser you will see that only the “From footer” text is shown.
Just what I need! Thanks again, Greyelf!