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 updated the task description. (Show Details)Jan 31 2016, 6:05 PM
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 closed this task as Declined.Feb 1 2016, 2:59 AM
Jackmcbarn claimed this task.
Jackmcbarn added a subscriber: Jackmcbarn.

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.