Howdy, Stranger!

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

[sugarcube] Disable footer passage in certain passages.

Is there a way that I can disable the footer render for just a couple of passages? The footer will house player stats but there is the intro passages like the intro where this is not needed.

Comments

  • Literally disable, no. Effectively disable, by causing it to output nothing, yes.

    The easiest way would be to wrap the contents of the PassasgeFooter special passage within an <<if>> which excludes passages by either name or tag.

    Exclude By Name
    In the following example, the PassasgeFooter generates output for all passages except the one named Intro.
    <<if passage() isnot "Intro">>\
    Your normal PassasgeFooter content goes here.
    \<</if>>
    

    If you have multiple introductory passages, then I'd suggest using a temporary variable to cache the result of passage(). Thus, in the following example, the PassasgeFooter generates output for all passages except those named Intro1 and Intro2.
    <<set _passage to passage()>>\
    <<if _passage isnot "Intro1" and _passage isnot "Intro2">>\
    Your normal PassasgeFooter content goes here.
    \<</if>>
    


    Exclude By Tag
    In the following example, the PassasgeFooter generates output for all passages except those tagged with nofooter.
    <<if not tags().includes("nofooter")>>\
    Your normal PassasgeFooter content goes here.
    \<</if>>
    
  • Could something similar be used for headers and use a tag as the criteria? That is, could I tag the passages where I don't want the header with, let's say "noHeader", and use that to disable the header on those passages?
  • Answer: Yes. Should've tried it before asking.
Sign In or Register to comment.