Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
All The Tropes Wiki Project, Part XXI
RE: All The Tropes Wiki Project, Part XXI
I knew that once... let me check...

Right -- the "State" parameter: 
Quote:state* [autocollapse, uncollapsed, collapsed, plain, off]
  • Defaults to autocollapse. A navbox with autocollapse will start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. For the technically minded, see MediaWiki:Common.js.
  • If set to collapsed, the navbox will always start out in a collapsed state.
  • If set to plain, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered (by using padding to offset the v • d • e links).
  • If set to off, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden.
  • If set to anything other than autocollapse, collapsed, plain, or off (such as "uncollapsed"), the navbox will always start out in an expanded state, but have the "hide" button.
To show the box when standalone (non-included) but then auto-hide contents when in an article, put "uncollapsed" inside <noinclude> tags:
  • state = <noinclude>uncollapsed</noinclude>
  • That setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]" but then auto-collapse the box when stacked inside an article.
Often times, editors will want a default initial state for a navbox, which may be overridden in an article. Here is the trick to do this:
  • In your intermediate template, create a parameter also named "state" as a pass-through like this:
  • | state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}
  • The <includeonly>| will make the template expanded when viewing the template page by itself.

(From here. This also appears in Navbox/doc when you view the template on the wiki.)

Our navbox template seems to be defaulting to plain instead of autocollapse.

EDIT: I think we can use that last bit of info in the doc above to modify our local Template:Navbox? At the very least we can manually add state=autocollapse to the templates we create ourselves.
-- Bob

I have been Roland, Beowulf, Achilles, Gilgamesh, Clark Kent, Mary Sue, DJ Croft, Skysaber.  I have been 
called a hundred names and will be called a thousand more before the sun grows dim and cold....


Messages In This Thread
RE: All The Tropes Wiki Project, Part XXI - by Bob Schroeck - 08-25-2021, 07:18 AM

Forum Jump:


Users browsing this thread: 7 Guest(s)