Template talk:RunningHeader

Latest comment: 1 month ago by Beeswaxcandle in topic Confusing usage line

Smaller edit

Sometimes one sees the header have different formatting than the body, often this is smaller text, italics or UC. While the latter two formats generally do not apply to page numbers, SMALLER often applies for the line. Currently one has to format each part of the running header to implement varieties of formatting, and it would be nice if there was a parameter that modified the text format of the whole header in one fell swoop, even if it was just smaller, that would be a big help. -- billinghurst (talk) 13:44, 19 August 2009 (UTC)Reply

{{smaller block|{{running header|...}}}} will do the trick. Hesperian 04:04, 4 February 2014 (UTC)Reply

3 part headers without a center don't clear edit

I noticed this while looking over Index:Tales of John Oliver Hobbes.djvu which uses a format like this and comes out pretty awful. This isn't intended, is it? Is there anything currently relying on this behavior? Prosody (talk) 23:10, 3 February 2014 (UTC)Reply


I regularly find myself tempted to revert this template to a simple table. It would be so much simpler, easier to maintain, and it would work perfectly... only it wouldn't be principled — no true gentleman uses tables for layout. Hesperian 03:21, 8 February 2014 (UTC)Reply

Center text doesn't center when there's left text edit

Could someone add a note to this template page to let editors know that this template does not exactly center the centered text? The template is intended to do that, but it seems like there's some technical reason it doesn't do it right now. Outlier59 (talk) 13:23, 1 June 2016 (UTC)Reply

I added that note. Outlier59 (talk) 01:05, 2 June 2016 (UTC)Reply
Note from the future (well, 2020): CSS flexbox would allow this to work, if you set the child divs to something like "flex-grow: 1; flex-basis:0;". Inductiveloadtalk/contribs 14:54, 19 June 2020 (UTC)Reply

5-part headers edit

How hard would it be to add support for 5-part headers (or "left-" and "right-aligned" versions of the 4-part header)? In certain circumstances (e.g. many of the pages in Index:Public_General_Statutes_1896.djvu, outside of the tables from pp. 14 to 248, inclusive) there is a need to have a "5-part" header. That is, three parts of the header are aligned to the left, center, and right of the body text, and an additional part (i.e. page number) is either on the far left or far right as appropriate. Pipian (talk) 10:42, 9 February 2017 (UTC)Reply

TemplateStyles version in sandbox edit

I've converted to TemplateStyles in the sandbox. Please take a look and/or merge if appropriate. --Izno (talk) 20:05, 21 October 2020 (UTC)Reply

Merging the various running header CSS pages edit

There are currently several different CSS pages for the various running header templates:

I think it would be a lot neater to merge them into one CSS page. This would allow {{RunningHeader}} and {{RunningHeader-centered}} to use the same basic styles, for the special classes in Template:Rh/3/styles.css to be used in other three-part running headers (like, well, {{RunningHeader}}), and for the CSS to be updated more easily because everything would be in the same place.

I've created a proposed update to Template:RunningHeader/styles.css at Template:RunningHeader/styles-sandbox.css. Feedback would be greatly appreciated. —CalendulaAsteraceae (talkcontribs) 08:22, 18 February 2023 (UTC)Reply

See also WS:AN#Edit requests for Template:RunningHeader. —CalendulaAsteraceae (talkcontribs) 03:56, 27 February 2023 (UTC)Reply

Migrating this template to Lua edit

This proposal is independent of the previous one. I've implemented this template in Lua using Module:RunningHeader, because Lua is better-suited to handling the logic necessary for {{RunningHeader/core}}. Based on Template:RunningHeader/testcases, it looks like everything's working, but considering this template is so widely used, I'd appreciate some additional eyes on my code. —CalendulaAsteraceae (talkcontribs) 01:28, 19 February 2023 (UTC)Reply

See also WS:AN#Edit requests for Template:RunningHeader. —CalendulaAsteraceae (talkcontribs) 03:56, 27 February 2023 (UTC)Reply
Nice work. It'll take me some time to grok this, but… Immediate thoughts:
Let's take the opportunity to move this to a standardised name. Module:Running header.
What's the reasoning for splitting the logic between Module:RunningHeader and Module:RunningHeader/core?
Have you updated the emitted markup to something sensible / modern? At first blush the CSS looks kinda grotty, so I'm guessing not, but I could be wrong.
We're using a custom / local Module:Roman here. Have you checked for upstream modules we could import instead of rolling our own? The name is also unfortunate as just "Roman" is amiguous. We should move this to Module:Roman numerals if we stick with a local module.
Have you looked into "API design" for the client templates? {{rvh}} was a quick test designed to be simple for simple cases; but experience has revealed some design flaws and limitations that necessitated {{rvh2}} etc. Can we find some way to generalise these so we can have fewer custom templates?
Incidental to this, but… I've toyed with the idea of a Gadget that can cooperate with the RH templates to automate populating the header in a lot more cases. Making the templates and emitted markup suitable for that might be worthwhile to keep in mind. Premature to make a primary design goal, but just sorta keeping it in mind so we make that easier in future. Xover (talk) 09:29, 3 June 2023 (UTC)Reply
PS. Given how widely used it is we'll have to communicate with the community before finally pulling the trigger, warning about upcoming changes, guiding them to were to get help and provide feedback, etc. Xover (talk) 09:30, 3 June 2023 (UTC)Reply
As I have already expressed before at some other occasions, I am quite unhappy about the rising number of templates which are getting dependent on a very small number of people understanding Lua. So I would like to ask, whether we have experienced any specific problems with this template which could not be solved in the common wiki code and which force us to migrate it to Lua. --Jan Kameníček (talk) 12:16, 3 June 2023 (UTC)Reply
That is a very valid concern. My motivation is that the underlying code for {{RunningHeader}} is already trying to do complex logic which wikicode isn't really suited to. —CalendulaAsteraceae (talkcontribs) 19:21, 3 June 2023 (UTC)Reply
Looking at this again with fresh eyes, I actually think it would be better to just have Module:Running header doing the running header logic, then separately have Module:Recto-verso providing the recto-verso logic, and use combinations of these two modules/templates for all the fancy recto-verso header stuff.
I have not updated the emitted markup and don't really know what 'better' would look like here. Would appreciate info on modern best practices!
I haven't checked for upstream Roman numeral modules. What do you think of commons:Module:Roman and w:Module:Roman?
Re "API design", I haven't looked into that very much, but I'll think about it!
CalendulaAsteraceae (talkcontribs) 19:18, 3 June 2023 (UTC)Reply
OK, I've updated so that {{recto-verso}} is now using Module:Recto-verso and {{RunningHeader/sandbox}} is using Module:Running header and Template:RunningHeader/styles/sandbox.css. The following templates are now using {{RunningHeader}} and {{recto-verso}}:
The following templates will be redundant to the updated {{RunningHeader}}:
{{Rh/1rv}} is using {{Rh/1}} and {{recto-verso}}. {{Rh/lr}} is using {{Rh/2}} and {{recto-verso}}. (Both will be able to be updated to use {{RunningHeader}} and {{recto-verso}}.)
{{RunningHeader-centered}} is doing some more complicated stuff so it's using a module, Module:Running header centered, although I do wonder how necessary it is to support setting column width with a parameter as opposed to index CSS.
Probably some of these templates can be merged. —CalendulaAsteraceae (talkcontribs) 21:15, 3 June 2023 (UTC)Reply
Belatedly, @Xover, and also I've realised that this proposal is not separate from the stylesheet update proposed in the previous section. —CalendulaAsteraceae (talkcontribs) 21:42, 3 June 2023 (UTC)Reply

Confusing usage line edit

The last line of the usage paragraph says "By default, all heading "cells" are center-aligned, except for the first cell, which is left-aligned, and the last cell, which is right-aligned." However, to me, that seems to imply that {{rh|left|right}} should have left to the left and right to the right, since right is in the last cell. Looking at your first example though, right is centered. This seems contradictory or in need of updating the usage sentence to clarify. Shootmanng (talk) 17:47, 23 February 2024 (UTC)Reply

A two-cell rh is really a three-cell rh with a blank third cell. There is an update process in progress at present to remove the current version of two-cell running headers. But this is a gradual process given the huge number of usages. I'll tweak the "by default" sentence. Beeswaxcandle (talk) 17:56, 23 February 2024 (UTC)Reply