Page MenuHomePhabricator

MCR support in TemplateStyles
Open, LowPublic

Description

Once MCR is ready, most template styles should be slots on the template page instead of separate pages. This requires T187935: Allow cross-slot access during HTML rendering. and figuring out the details of multi-slot transclusion.

What to do when the same style is shared by multiple templates is less clear. It can be worked around (put the style on an empty template, transclude that template into all templates needing the styles), but we might want to handle it via slot-level redirects. (The same also applies to T200614: Provide a way to document template styles or add other text to those pages.) We could also handle it on the CSS parser level by supporting @import (and maybe turning it into something akin to module dependencies in ResourceLoader?) but that seems vastly more complicated without any clear benefit.

Also unclear whether we require an empty <templatestyles /> tag to include styles from the local slot or do it automatically? This somewhat depends on how multi-slot page proctection will be implemented - if different slots have different protection levels (something we probably want, at least for documentation subpages), care should be taken to prevent people from changing a protected template by creating a TemplateStyles slot on it.

Related Objects

StatusAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedAbit
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone

Event Timeline

Izno created this task.Jul 30 2018, 12:20 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 30 2018, 12:20 PM
Tgr added a subscriber: Tgr.EditedJul 30 2018, 5:23 PM

I imagine the two options are to use the current semantics (create CSS as a separate page instead of a templatestyles slot), and to support redirects in the templatestyles slot. IIRC how redirects should work in non-main slots is still an open question.

Izno added a comment.Aug 3 2018, 8:20 PM

There's actually the other case of a plain old documentation slot which can be referenced from multiple places also.

Tgr renamed this task from Consider how MCR and TemplateStyles will interact to MCR support in TemplateStyles.Sep 24 2018, 8:49 PM
Tgr updated the task description. (Show Details)
Tgr updated the task description. (Show Details)Sep 24 2018, 8:57 PM
Izno added a comment.EditedSep 24 2018, 9:06 PM

f different slots have different protection levels (something we probably want, at least for documentation subpages),

I think that is a bit offtopic to this task, and gets to more general questions that probably deserve their own tasks. We definitely do want different protection levels per slot for that reason, which probably deserves its own ticket. The documentation slot should also not cause the rest of the template to update on every other page, unless the main slot was changed, so that's probably yet another ticket. The general question of slot transclusion across templates is also a question that probably deserves its own task since that doesn't look answered by T187935.

In general, there are a few of these questions. I just filed the one that was interesting to me at the time. 😃

I think we should stick to the well known system of separated pages for different purposes.

  • They might have different protection level.
    • Documentation might be changed by everybody, since that affects one other page only, while template programming and CSS get higher protection until sysop only, since affecting perhaps a million pages.
  • They have an independent revision history.
    • It is crucial to identify a history of effective programming changes and nothing else, or of CSS changes only to identify bugs and recent changes causing problems. A mix-in of various documentation and test example issues into one page history is undesirable.
  • They have independent Whatlinkshere.
    • It is crucial to know which "slot", currently which transcluded page is influencing which other page. If everything is merged into everything since one slot is involved nobody can maintain templates any longer. If I want to know which pages are affected from TemplateStyles but not necessarily transcluding the mother template around I do need separated lists.
  • In the end it stays at one page per purpose, and one slot within that page; and rather than multi-slot in one page it is more meaningful to have a group of independent 1-slot-pages related together. That is good practice for more than a decade.
  • The mix-all-slots-in-one page will result in a very complicated system for editors and sysops, who cannot follow any longer a history or identify particular protection. At least most confusing and challenging for regular users who are not MediaWiki developers.

In the particular case of CSS there is not only one slot with style definition, but also a separate documentation of CSS required.

  • Please find a pretty example explaining the purpose and effect of classes, and providing a test suite comparing expected and current result.
  • The template documentation page is heading for authors who are transcluding the template into an article.
  • The template styles documentation page is targetting at maintainers and developers of the implementation, but too confusing for end users.
Izno added a comment.Sep 25 2018, 11:19 AM

I think we [snip]

Most of this is off topic. You are welcome to leave off topic comments on the MediaWiki wiki page. Not on random tasks in Phabricator. I will be back later to comment on the substance.

Izno triaged this task as Low priority.Sep 28 2018, 1:45 PM
Izno moved this task from Up next to External on the TemplateStyles board.