Skip to main content
LinSims
Community Expert
Community Expert
March 11, 2021
Question

RunningHeader variable: prevent display of a lower level paratag

  • March 11, 2021
  • 2 replies
  • 325 views

For navigation purposes I like to have the main heading and the first subheading on a page display at the top of a page. 

 

My paragraph tags are defined as follows:

H1 Heading 1 is used for the chapter title

H2 Heading 2 is used for the main heading

H3 Heading 3 is used for the subheading

 

I use Running H/F variables to pull the text from the main heading and the subheading into the headers. 

Running H/F 1 is defined as: <$paratext[H2 Heading 2]>

Running H/F 2 is defined as <$paratext[H3 Heading 3]>

 

So far, all pretty standard. The issue arises when there's a new H2 Heading 2 on a page but there's no following H3 Heading 3. The header updates to use the new H2 Heading 2, but it's still using the information from the H3 Heading 3 that goes with the previous H2 Heading 2, and that's no good.

 

How do I get it to not do that? Or more precisely, if a new H2 Heading 2 is showing on a page that doesn't have a new H3 Heading 3 below it, how do I get the variable to be blank instead of showing whatever the most recent H3 Heading 3 text was? I can't be the only person this has been an issue for, so I'm sure a way around this has been found. I just haven't managed to turn it up yet.

 

Any pointers?

This topic has been closed for replies.

2 replies

LinSims
Community Expert
LinSimsCommunity ExpertAuthor
Community Expert
March 11, 2021

Botheration. I had a feeling that was the case.

 

I guess what I'll do is create two new master pages without the secondary heading and apply them pre-publication. It's a nuisance.

frameexpert
Community Expert
Community Expert
March 11, 2021

I wonder if a clever way to do this is to have a secondary H2 Heading 2 paragraph format that indicates that no heading 3 follows it (H2 Heading 2_solo). Then you could use a master pages map to automate the application of the master pages.

LinSims
Community Expert
LinSimsCommunity ExpertAuthor
Community Expert
March 11, 2021

<thoughtful> That could work. Or come to think of it, I have the Silicon Prairie Master Page tools, and I could just insert a Master Page marker in the heading. Either would work, but both require remembering that either the tag or the marker would have to be changed if at some future point subheadings wormed their way in.

 

I'll have to think about that.

frameexpert
Community Expert
Community Expert
March 11, 2021

You might be stuck using Running H/F markers and some kind of scripting solution to insert blank ones where necessary.