Page MenuHomePhabricator

suppress TOC by default on zhwikinews main namespace
Open, MediumPublic

Description

The zhwikinews community believes that there is no need for the TOC affecting the browsing experience on the news page (i.e., the main namespace). It is hoped that the TOC can be suppressed in the main namespace from the software level by default.


Original task content:

Is technical implementation feasible? The local community expressed strong support in the Telegram group.

image.png (1×1 px, 313 KB)
To avoid any misunderstanding, the term '目錄' refers to the section on the left-hand side of the news page, which includes '目次' (Table of Contents), '隱藏' (Hide), '序言' (Introduction), and '消息來源' (Sources) in Chinese. The left-hand side table of contents is not useful for Wikinews articles. So they want to turn off the left-hand menu on all main pages on Vector (2022) by default for everyone on zhwikinews, including readers.

Event Timeline

SunAfterRain renamed this task from Default closed menus on Vector (2022) for zhwikinews main pages to suppress TOC by default on zhwikinews main namespace .Jan 25 2024, 2:37 PM
Func subscribed.

The main issue is that vector 2022 would display a TOC no matter there are more than 3 sections or not.

Jdlrobson added subscribers: cscott, Jdlrobson.

@cscott is there a way to globally suppress the table of contents on a project-level in the parser? It seems like that would be the logical thing to do here to resolve this ticket. Vector 2022 would then just work without hacky workarounds.

This request is to ask about suppress the table of contents on a namespace-level afaik.

Could you just do this with site css -- MediaWiki.css could contain the rule:

.mw-table-of-contents-container { display: none }

and everything would Just Work, right? If you only want this on main namespace changes you could probably do this dynamically with a Gadget instead.

If you wanted to do it on a project level, you could install a very simple extension on the project which used the ArticleParserOptions hook, and use ParserOptions::setSuppressTOC(). That could also be namespace-specific:

	public function onArticleParserOptions(
		Article $article, ParserOptions $popts
	) {
             if ($article->getTitle() ... finish the namespace check here ....) {
                 $popts->setSuppressTOC();
            }
       }

A rough translation of the original user request:

Default closed directory

Default main page directory: Default closed menus on Vector (2022) for zhwikinews main pages. Is technical implementation feasible?

I checked Russian Wiki News or Wiki News in other languages. Their new skin will close the directory when browsing news reports. I think this is suitable for deployment on this site, because the news report pages of Wiki News do not need a directory. In addition, even if there is a directory, it can be replaced by a related template. There is no need to open this directory and it can be hidden by default, which can make it easier to display the report text. There is no need to display this redundant directory, because all current report directories only have news sources. , and then it disappears. In fact, it has no purpose, and in the old version, no directory will be displayed in this case. A strong reason is to hide the directory on the left, which can display more text content, make the news experience richer, and provide a better browsing experience on platforms such as iPad or computers without the need to display this redundant Things hinder the proportion of the interface, because all news reports only have the title of source in the table of contents; even if the news report has a title, there is no need to have a left column of the title (new version of the skin) to display it. There is also a table of contents template that can be used instead. Because this greatly hinders the browsing experience of news reports, the design of this directory is only suitable for Wikipedia. News reports do not need to do this. News reports rarely use clicks in the directory. Usually the subtitles are simply displayed, and there is no need to have a directory. Click on it. But I don’t know how he implements this issue, and now I’m asking for everyone’s opinions. I support it. Kitabc12345 (leave a message) January 13, 2024 (Saturday) 05:29 (UTC)

In addition, I hope there is technology that can make it easier to fill in the source template, because most news websites can actually easily get the title and what organization it comes from. In fact, maybe there can be tools developed to make it faster? Kitabc12345 (leave a message) January 13, 2024 (Saturday) 05:34 (UTC)

(+) Support closing directories under all skins. Zhuofan WuCien años de soledad February 5, 2024 (Monday) 13:06 (UTC)

We should get some clarity about exactly what's required -- there are three points from the original request that I think are being lost here:

  • "I checked Russian Wikinews or wikinews in other languages" -- if this is already being done for other wikinews sites we should figure out how/what they are already doing. If it's already being done elsewhere then it's "technically feasible" for sure.
  • "A strong reason is to hide the directory on the left, which can display more text content" -- removing the ToC is not going to remove the left sidebar, which seems to be what's asked for here. And in fact the left sidebar is already removed when the device width is narrow enough, so the desired feature may already be present for "platforms such as iPad".
  • "close the directory" - the vector 2022 skin has a "hide" button next to the ToC, which moves it up to the heading bar (and then a corresponding "move to sidebar" button which moves it back). It may be that what is requested is not removing the ToC entirely but just starting with it in the default "heading" location, not in the "sidebar" location.

I don't know about the technical feasibility of the second two points here -- defaulting to the "narrow screen" layout with sidebar suppressed, or starting with the TOC in "heading" location. But I'm also not 100% certain about what is being asked for, so it's worth clarifying further.

ovasileva triaged this task as Medium priority.Thu, Apr 4, 9:05 AM