How do we implement a widget or macro like navbox on mediawiki?

I think there is a step missing here somewhere, @TW_Tones. While the Template:Navbox - MediaWiki template which I linked to before is considered to be a meta-template, it isn’t the one that will ultimately get transcluded into the actual wiki article content tiddlers. It just creates the general structure for all navboxes. From there, the individual navboxes themselves are created as separate templates, such as Template:Global templates nav - MediaWiki which will then get transcluded to the bottom of every article (tiddler) which is listed in that template. For now though, I am just working at the meta- level, creating the general foundation for all navboxes.

Example from MediaWiki
If you have a look at the source of the Template:Global_templates_nav example linked above, you’ll see that it invokes the Template:Navbox template. Meanwhile, the Global templates/Proposed specification, short version - MediaWiki article invokes just the Template:Global_templates_nav template, which uses the Template:Navbox template for its basic structure.

On MediaWiki, this isn’t just one template, and I would doubt that TiddlyWiki would handle it all that differently either. The example shown in the opening post is actually from Template:Planetary Missions Program Office - Wikipedia which makes use of the Template:Navbox with collapsible groups - Wikipedia which in turn is built from a Lua module, Module:Navbox with collapsible groups - Wikipedia. There is a whole suite of underlying templates and modules which are used on MediaWiki-based wikis to give this functionality that the OP is asking for.

You can construct any level of complexity of templates containing templates and conditions for when those templates are used. It is all in your hands with tiddlywiki.

The two key approaches are using the view/edit template mechanisiums or the cascade mechanisium. Within either you can build what ever complexity you need.

  • My only firm recomendation is you use a field (or tag) to classify your tiddlers for which you want such a custom process to be applied to, leaving regular tiddlers to be used as regular tiddlers, such as if you open an existing tiddler, sidbar tab tiddler etc…

In many ways we can only suggest an answer to the question “How do we implement a widget or macro like navbox on mediawiki?” at a general level other wise you are asking us to research and produce specific, potentialy a bespoke solution for you. Any way while doing it, there will be questions that need answers so such a result would be “opinionated”.

Now to do with the “colapsable” part have a look in this forum or tiddlywiki.com for slider, collapsable, details, reveal, popups etc… they are all different ways to refer to what you are asking and well documented.

  • I recomend a more specific topic when you can produce a minimum test case where you are having trouble achiving what you want within the frame work suggested here.

I looked at the basic example for Module:Navbox with collapsible groups - Wikipedia. Attached is my attempt to replicate with Eric’s help to understand the filter logic.

MediaSimpleNavBox_tiddlers.json (5.7 KB)