Page MenuHomePhabricator

drop-down TOC for wikivoyage banners
Closed, ResolvedPublic

Description

Wikivoyage pagebanners have a unique Table of Contents showing only level one headings(horizontally), giving them a distinctive appearance, as shown below:

toc2.png (103×700 px, 129 KB)

However, there may be need to pack in more content, in sub-headings, for which there is a proposal to add drop-down links to the prominent horizontal TOC, in the pagebanner extension being developed.
Relevant discussions on wikivoyage are:
TOC comments
Full TOC button

While the task of creating banners is ongoing at T94772, it'll be better to discuss and finalize the nature and appearance of drop-down TOC, early on.
The initial idea as in the proposal at T93106 is to generate headings beyond level 1 as simple drop-down menus, of the horizontal TOC
Feedbacks, comments and views are most welcome!

Event Timeline

Sumit claimed this task.
Sumit raised the priority of this task from to Medium.
Sumit updated the task description. (Show Details)
Sumit added subscribers: Bene, Wrh2, Jdlrobson and 14 others.

Note: $parserOutput->setTOCEnabled( false ); can be used to disable the initial table of contents.
As a starting point I would look to enable a one level table of contents. If you can do this great but I don't think this is vital for the success of this project and can be added later on.

Change 218672 had a related patch set uploaded (by Sumit):
WikidataPageBanner toc added

https://gerrit.wikimedia.org/r/218672

Here is a preview of the TOC by current version of the above patch on a page about Asia

Very nice!
I like the fact that links are copyable via right-click (needed when sharing deep links).

The TOC does not appear in preview. While not useful during preview, it is good to have the same appearance during preview if possible.

Wikivoyage articles have only few root sections, with short names, so overflowing is not a problem for now (unless on mobile I guess). Example: http://pagebanner.wmflabs.org/wiki/Roppongi

Change 218672 merged by jenkins-bot:
WikidataPageBanner toc added

https://gerrit.wikimedia.org/r/218672

Not closing until we've got the flash of styles fixed!

Nicolas consider that other language versions (and/or other article types) may have more root sections and with longer names so they could fill at least two rows.
Maybe it's not a problem, but it must be taken into account.

@Andyrom75 when @Sumit works on making the table of contents mobile friendly we should find a suitable way of dealing with this. Should definitely be taken into account.

Actually it looks like it has already been taken into account: :)

Screen Shot 2015-06-24 at 12.02.34 PM.png (311×1 px, 330 KB)

Don't know if it's helpful, but according to the image optimization paragraph inside the mobile section of this link https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fpagebanner.wmflabs.org%2Fwiki%2FRoppongi&tab=mobile it says that it could be saved 99% of the information transfered between server and client.
I suppose that the reason can be found on the fact that it download this file https://upload.wikimedia.org/wikipedia/commons/6/6c/Ladakh_banner.jpg instead of a pre-resized version of it, for the small screen of a mobile.

There's something that can be done?

This comment was removed by Andyrom75.

Don't know if it's helpful, but according to the image optimization paragraph inside the mobile section of this link https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fpagebanner.wmflabs.org%2Fwiki%2FRoppongi&tab=mobile it says that it could be saved 99% of the information transfered between server and client.
I suppose that the reason can be found on the fact that it download this file https://upload.wikimedia.org/wikipedia/commons/6/6c/Ladakh_banner.jpg instead of a pre-resized version of it, for the small screen of a mobile.
There's something that can be done?

I looked into it, the provision to load banner of appropriate size is in place through srcsets, the desktop version seems to be doing fine, but the mobile skin is loading same values in all srcsets, which is why large size banners are loading in mobile. I've opened a bug for that, T103994, @Andyrom75 thanks for reporting!

A minor thing. In http://pagebanner.wmflabs.org/wiki/Culver_City caption parameter doesn't work.

Yes the caption parameter is yet to be merged in master branch, so its not there. See https://gerrit.wikimedia.org/r/#/c/214895/

@Andyrom75 follow T103476 for updates on the caption parameter :)

Sumit removed a project: Wikidata.