Page MenuHomePhabricator

Add a magic word which returns the number of sections in a given article
Closed, DeclinedPublic

Description

For various uses, like simulation of section edit links or to have a count or something similar in section links it would be nice to have an {{NUMBEROFSECTIONS:Pagename}} magic word.

Event Timeline

MGChecker raised the priority of this task from to Needs Triage.
MGChecker updated the task description. (Show Details)

Which level of section? This can probably done by Lua.

I think it should be as it is internal, that mean every section is counted no matter which level it has.

MGChecker set Security to None.
Aklapper renamed this task from Add a magic word wich returns the number of sections in a given article to Add a magic word which returns the number of sections in a given article.Jan 31 2016, 11:23 PM
Aklapper triaged this task as Lowest priority.
Jackmcbarn claimed this task.
Jackmcbarn subscribed.

This can't be done, since the number of sections in a page isn't known until after parser functions get evaluated. Imagine a page that contained {{#ifeq:{{NUMBEROFSECTIONS:{{FULLPAGENAME}}}}|0|== Section ==}}. This would cause a paradox.