Page MenuHomePhabricator

Functionality to partially transclude a page
Closed, ResolvedPublic

Description

Problem: The design principle of WikiProject X is that WikiProjects should surface the most relevant information, rather than embed entire features onto the main WikiProject page. WPX UI implements this by having up to four entries of a longer list transcludable, with the full list available via link. This is implemented through a rather nasty combination of Lua modules and noinclude/includeonly tags.

As part of the collaborationhub content model, it should be built in which elements are transcluded and which ones are not. Alternative approach would be some kind of list content model that includes a setting "transclude only X entries" and decide whether elements are transcluded in order or if random ones are selected.

Related Objects

StatusSubtypeAssignedTask
ResolvedIsarra
DeclinedNone
DeclinedNone
ResolvedIsarra
InvalidNone
DeclinedNone
DeclinedNone
ResolvedReedy
ResolvedNone
ResolvedReedy
ResolvedBawolff
ResolvedBawolff
ResolvedIsarra
ResolvedBawolff
ResolvedBawolff
ResolvedBawolff
ResolvedBawolff
ResolvedBawolff
ResolvedBawolff
ResolvedIsarra
ResolvedBawolff

Event Timeline

Harej moved this task from Needs Triage to Requests on the WikiProject-X board.

We now have transclusion in which the 'content' field of a collaborationhub page can be included in another via a list, but it currently just dumps in all of it.

I suppose we need two things here:

  1. Handling for plain wikitext pages - there is support for the 'content' field from a collaborationhub, but we also need to just be able to include some content off a wikitext page. This would likely be done via section transclusion per above above.
  2. Handling for including only some of the 'content' content - if a list, cutting it off after a certain number items, or if wikitext, per above.

...it also occurs to me that having a 'content' field in the content may have been an insanely bad idea.

We may also want to support manually setting which bits to transclude. For the wikitext, telling the parser YO THIS IS A TEMPLATE or otherwise adding support for the <includeonly> tags might be in order.

Assigning to @Bawolff since he is working on this as part of T135088.

So ContentHandler doesn't actually expose template arguments during transclusions, so this leaves two options:

  • {{List name}} and then have options for transclusion as part of the List page itself
  • {{#transcludeList:List name|count=5|order=random}} possibly with defaults on the list page.

Or both!

Also, presumably the Collaboration Hub will be using content handler directly, and not use the wikisyntax for transcluding, but instead have fancy UI or something.

With https://gerrit.wikimedia.org/r/#/c/292830/ implemented, should this be closed, or does this also include transcluding hub pages?

This should be closed. (I am, for the time being, not concerned with how partial transclusion would work on things other than lists, since it's not something we currently deal with in WPX UI.)

I moved it to the Done column but wanted you to confirm yourself the task was indeed done.