The current implementation of MediaWiki:Sidebar supports a completely undocumented * {{msg}} syntax.
It works along the lines of: * header ** {{msgname}}
And ends up with a 'header' section with the parsed contents of MediaWiki:Msgname outputted into it.
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 Implementation: * The implementation is a mess, with successive {{msgname}} calls in the same header replacing rather than appending to, 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.
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'd like to remove this feature from 1.18 before it ends up released and people actually start using this feature in production where we start having to deal with backcompat. Are there any objections to it being removed?
On 20/08/11 01:50, Daniel Friesen wrote:
The current implementation of MediaWiki:Sidebar supports a completely undocumented * {{msg}} syntax.
<snip>
Are there any objections to it being removed?
The sidebar code is a hack and it is far from being user friendly. User currently has to edit: - [[MediaWiki:Sidebar]] - a message for link - a message for link name
We should just rewrite it from scratch, using some Special page to easily add / remove links. Save them to the database and the cache system.
As for the {{msg}}, it might help if you list the revisions.
On 11-08-20 02:58 AM, Ashar Voultoiz wrote:
On 20/08/11 01:50, Daniel Friesen wrote:
The current implementation of MediaWiki:Sidebar supports a completely undocumented * {{msg}} syntax.
<snip> > Are there any objections to it being removed? The sidebar code is a hack and it is far from being user friendly. User currently has to edit: - [[MediaWiki:Sidebar]] - a message for link - a message for link name
We should just rewrite it from scratch, using some Special page to easily add / remove links. Save them to the database and the cache system.
I didn't mention it, but with the navigation message parser I'm building, instead of creating instances of NavigationMessageParser and describing the format of the messages I actually use a $wg var with the definitions of the navigation message formats. The point there is actually so that if someone decides to build something like a Special:EditNavigation page, Special:EditNavigation will be able to list the navigation types, and Special:EditNavigation/sidebar, Special:EditNavigation/header, etc... will know what format the message is and be able to let the special page give the user an interface I should point out that the fact the {{msg}} syntax is there would also be in the way of a navigation editing ui.
Though I suppose you do have a good point, completely dropping this system of using MediaWiki: messages for configuration is something to seriously consider.
As for the {{msg}}, it might help if you list the revisions.
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki...
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
2011/8/20 Ashar Voultoiz hashar+wmf@free.fr
The sidebar code is a hack and it is far from being user friendly. User currently has to edit:
- [[MediaWiki:Sidebar]]
- a message for link
- a message for link name
Afaik that's not true. Those 3 steps are only needed if you need internationalization, in which case it makes sense to have multiple pages. If you just want a simple link and link name you can just use:
*Some article|Click here!
In which case the magic sidebar code will indeed look if there's a message by that name, but if there is not it will output that text raw. So there is no requirement to create two separate messages.
2011/8/20 Ashar Voultoiz hashar+wmf@free.fr
We should just rewrite it from scratch, using some Special page to easily add / remove links. Save them to the database and the cache system.
Yes, definitely! This has been brought up a few times before and I think it's an obvious thing to do.
It was brought up as a project for GSoC:
"Sidebar/toolbar customization GUI"
Regarding the maintainability and automation from one wiki to another, I a shared table solves that easily if it needs to be synchronized across a wiki farm. And if only needed once or twice (export / import) one can use database table export/import from phpMyAdmin even. That's no different from any other database (ie. interwiki).
The Sidebar feature could have an API module or SpecialPage-action that allows exporting to, for example, JSON. Which an then be imported on another wiki through the API or a SpecialPage-action.
(eg. api.php?action=sidebar&op=export or Special:Sidebar/export).
-- Krinkle
Why don't you guys just make MediaWiki:Sidebar just be (interpreted as) a standard wikitext file. OK, call it MediaWiki:SidebarII or MediaWiki:Snidebar etc., which if exists will be used instead of MediaWiki:Sidebar.
Why on earth would we call it the snidebar?
-Chad On Aug 28, 2011 9:45 PM, jidanni@jidanni.org wrote:
Why don't you guys just make MediaWiki:Sidebar just be (interpreted as) a standard wikitext file. OK, call it MediaWiki:SidebarII or MediaWiki:Snidebar etc., which if exists will be used instead of MediaWiki:Sidebar.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
- Horrible syntax becomes even more horrid - i18n nearly goes out the window - Accesskeys go out the window - External links don't work the same in the sidebar as they do in WikiText - Sidebar markup differs between skins... because rightfully that's the skin's decision to make on how it's laid out and styled - The user's ability to reposition the toolbox and language box disappears, search to if you're using monobook
Please spare the ml all these unhelpful comments you keep making.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
On 11-08-28 06:44 PM, jidanni@jidanni.org wrote:
Why don't you guys just make MediaWiki:Sidebar just be (interpreted as) a standard wikitext file. OK, call it MediaWiki:SidebarII or MediaWiki:Snidebar etc., which if exists will be used instead of MediaWiki:Sidebar.
Isn't there some way to use standard wikitext to achieve the same rendered result as
$ GET http://abj.jidanni.org/index.php?title=MediaWiki:Sidebar&action=raw * navigation ** mainpage|mainpage-description ** Special:NewPages|newpages ** Special:Categories|categories ** recentchanges-url|recentchanges ** randompage-url|randompage * SEARCH * TOOLBOX * LANGUAGES
That way there would be no need to maintain a separate "sidebar language" interpreter.
<div id="p-navigation" class="portal collapsed"> <h5>{{int:navigation}}</h5> <div class="body"> {{#ifeq:{{int:mainpage}}|-|| * [[{{int:mainpage}}|{{int:mainpage-description}}]]}} * [[Special:NewPages|{{int:newpages}}]] * [[Special:Categories|{{int:categories}}]] {{#ifeq:{{int:recentchanges-url}}|-|| * [[{{int:recentchanges-url}}|{{int:recentchanges}}]]}} {{#ifeq:{{int:randompage-url}}|-|| * [[{{int:randompage-url}}|{{int:randompage}}]]}} </div>
And: - Getting those #ifeq's right might actually require some extra <nowiki/>s - Accesskey config still goes out the window - External links still don't work the same way - The markup isn't portable to all skins - The SEARCH/TOOLBOX/LANGUAGES repositioning ability disappear. - We end up using a hugely complex parser just to parse something that is actually relatively simple
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
On 11-08-30 04:59 PM, jidanni@jidanni.org wrote:
Isn't there some way to use standard wikitext to achieve the same rendered result as
$ GET http://abj.jidanni.org/index.php?title=MediaWiki:Sidebar&action=raw
- navigation
** mainpage|mainpage-description ** Special:NewPages|newpages ** Special:Categories|categories ** recentchanges-url|recentchanges ** randompage-url|randompage
- SEARCH
- TOOLBOX
- LANGUAGES
That way there would be no need to maintain a separate "sidebar language" interpreter.
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]. What kind of transclusion syntax would you want? Template parameters???
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...
1- http://www.mediawiki.org/wiki/Manual:Sidebar#Allow_wiki_markup_.28PHP.29
~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.
wikitech-l@lists.wikimedia.org