Page MenuHomePhabricator

Provide toclimit-2 and .toclevel-1 support in tablet table of contents
Closed, ResolvedPublic

Description

Author: stillwaterising

Description:
Template:TOC limit does not work in mobile browsers that show the TOC by default.

Example URL: http://en.m.wikipedia.org/w/index.php?title=Islamic_State_of_Iraq_and_the_Levant&oldid=628558101

Expected Results: Only level 2 heading shown (as is done on Desktop view)

Actual Results: Headings are not limited in mobile view
In source view it looks like:
<div class="toclimit-2"></div>
<div class="toc-mobile">

<h2 aria-controls=....

</div>

Additional Builds and Platforms: Tried multiple mobile user agents on Firefox


Version: unspecified
Severity: enhancement
Platform: Tablet PC

Details

Reference
bz71726

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:50 AM
bzimport set Reference to bz71726.
bzimport added a subscriber: Unknown Object (MLST).

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Trello card https://trello.com/c/5iungbbW

I'm pretty sure that it's because the appropriate rule is in [[:en:MediaWiki/Common.css]] but not in [[:en:MediaWiki/Mobile.css]]

Whoops. I meant [[:en:MediaWiki:Common.css]] and [[:en:MediaWiki:Mobile.css]].

Will Phabricator offer (a) a "preview" feature and (b) the ability to amend your own posts?

The table of contents in the mobile site is generated totally different from the desktop skin to give us more control to style it/position it appropriately for mobile/tablets. We currently do not support the css selectors that are used in Common.css and I'm not sure if we would want to. Thus marking as an enhancement for further consideration.

I'm not sure what the advantage of this is (or would be). The ToC is the basic element where the user can orient when reading the article, so why remove (maybe important and interesting) contents? Just my opinion :)

After discussing with other MobileFrontend developers we will not be adding classes to support this kind of thing.

If you want to do this on a global basis you can already do
.toc-mobile ul ul { display: none; }

Doing this on a per template basis would be possible with the completion of https://www.mediawiki.org/wiki/Requests_for_comment/Allow_styling_in_templates
but we won't be doing this as part of the MobileFrontend extension as we cannot guarantee we will maintain it.

Jdlrobson changed the task status from Declined to Resolved.Jan 6 2015, 4:36 PM
Jdlrobson claimed this task.

Since this can be done with css in MediaWiki:Mobile.css closing this as resolved.