I don’t know of any way to run code within the footer in Chapbook. It doesn’t have a dedicated header and footer passage, that I know of, just a pre-built <div>
structure that you can send stuff to display. That was an important missed opportunity, I feel. However…
You could replace the Stats link in the footer template with a disabled version from within in the Stats passage code. That would be quite straight forward. And if you had more menu-type passages you could disable all the those links upon visiting any one of them to avoid navigating amongst them and hindering the {back link}
insert going to the proper story passage. That would work too.
For coming back to a story passage (that shouldn’t trigger variable manipulation again), I suppose you could check the third last passage in the trail
for a match to the current one, since all other navigation was disabled in the Stats passage. It would look like [..., "Passage 24", "Passage 25", "Stats", "Passage 25"]
at that point. You would also have to embed a passage that reinstates the menu-type links for every story passage. (Unfortunately, this draws dashed connection lines in the Twine editor from practically every story passage so it makes the layout of it all messy, but it works – and this is why proper header and footer passages would be a godsend.)
I don’t know. My flux capacitor, time travel solution might be cleaner. Just saying.
Sometimes, when you’re so used to swingin’ a hammer though, every problem looks like a nail. I’ll be the first to admit that I over engineer things.
I was able to make my own embedded (JavaScript-only, unfortunately) passage code that doesn’t draw those dashed lines all over the Twine editor passage map grid. And I have a very nice solution to check tags that are assigned to a passage. Chapbook ignores the tags that Twine provides, but the Twine raw data still exists hidden in the HTML thankfully.
I’m liking Chapbook quite a bit, but it really requires JavaScript knowledge to make it comparable to other story formats. There’s so much to Chapbook that I still don’t understand though. That said, I’m going to keep pushing hard with Chapbook, but I was doing a little reading on Snowman 2 and it looks like another potential candidate.
By the time I’m done, I’ll know everything except SugarCube. I think I’m a story format hipster. I just can’t go with the flow. Marching to beat of my own drum… right off the edge of the cliff.