~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
On 11-08-23 02:40 PM, Platonides wrote:
Daniel Friesen wrote:
The current implementation of MediaWiki:Sidebar supports a completely undocumented * {{msg}} syntax.
My fault.
This feature didn't exist in 1.16, was introduced but was seemingly completely broken in 1.17 and finally made to work in 1.18.
However I have a number of issues with it: Conceptually:
- The concept makes little sense, it uses the {{}} template syntax, but
actually takes a message from the MediaWiki namespace, and it of course doesn't support any real transclusion syntax
People was *hacking* the code to include arbitrary wikitext [1].
How about we re-educate them on how to use the hook we have to introduce new wikitext blocks to the sidebar? Or perhaps something outside of mw:sidebar that lets us say to embed things like MediaWiki:Sidebar/foo's WikiText into the sidebar. Though, if someone is already modifying core, then telling them to put a hook into their LocalSettings.php isn't any worse since they already need php access to do the hack in the first place.
What kind of transclusion syntax would you want? Template parameters???
Just saying that it's using transclusion syntax, but it doesn't behave like transclusion syntax. It doesn't come from Template: by default, in fact you can't even tell it to come from anywhere but a message, and yes of course, if you tried to use parameters it wouldn't work.
Implementation:
- The implementation is a mess, with successive {{msgname}} calls in the
same header replacing rather than appending to,
Several "{{msgname}} calls" were never really expected. You are right in that appending would make more sense.
and using a mess of a setup where these blocks are actually put into a separate array which is array_merged into the real sidebar array at the end.
I think there was some reason for doing it that way...
But mostly I have a problem with the fact that it's getting in my way. I'm currently trying to fix up the limitation in our skin system that only allows us to sanely have one type of navigation (the sidebar). With the implementation of a new navigation message parser that can handle varying formats of messages. However {{msgname}} is not something that can see be cleanly implemented in it.
I donn't understand what you are trying to do there, or why {{msgname}} is a problem...
I'm trying to expand support from our limited support for: MediaWiki:Sidebar with the format: * section ** link|text
To support additional navigation such as: A single level header with the format: * link|text * link|text
A recursive navigation menu with the format: * link|text ** link|text *** link|text **** link|text *** link|text
And any other navigation that a skin wants to insert. The fact that we ONLY support MediaWiki:Sidebar and if a skin designer wants ANY other type of navigation they either have to hardcode it or completely re-implement navigation parsing in their skin is a flawed limitation in our skin system I'm trying to fix.
I implemented a NavigationMessageParser that can parse MediaWiki:Sidebar's syntax and also the other variances like infinite depth, levels that support links and levels that don't, etc... But right now I can't see {{msgname}} being worked into that parser without a huge hack.
1- http://www.mediawiki.org/wiki/Manual:Sidebar#Allow_wiki_markup_.28PHP.29
To be fair though. A comment in the commit, and also one of the replies here have both brought up how flawed MediaWiki:Sidebar is from the start and the whole idea of replacing it with a special page interface. I do admit there that such a thing could handle wikitext blocks much better than any MediaWiki:Sidebar syntax we could come up with or any hook.