Jump to content

Template talk:NUMBEROFSECTIONS

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Bad idea

[edit]

@Fred Gandt: This module doesn't really seem like a good idea. The number of sections in a page aren't known until after all templates/modules/variables are already expanded. To illustrate this problem, consider a page that contained {{#ifeq:{{NUMBEROFSECTIONS}}|0|== Some section ==}}. Now the module is wrong no matter what it outputs. When is it useful to know this, anyway? Jackmcbarn (talk) 16:47, 24 March 2016 (UTC)[reply]

The question came up at the tech pump and this is an answer. It's another metric, that has only as limited a value as many others (these things always depend on perspective). Counting what's actually there is never wrong in a cached environment; we're always a few steps out of sync - it's pretty much unavoidable without AJAX.
Since you chose to lead with "Bad idea" instead of a more positive "Is this a good idea?" or "There's a problem that might need addressing", I shan't waste my time trying to convince you otherwise. It is what it is, and this project works the way it works. fredgandt 17:18, 24 March 2016 (UTC)[reply]
Sorry about the heading; I didn't mean for it to come across that way. I don't really notice a purpose mentioned for it there, but my gut feeling is that a JavaScript solution would be better. Jackmcbarn (talk) 19:28, 24 March 2016 (UTC)[reply]
Whilst I agree that JS does a better job, it's limited to the client's use; this makes the result embeddable for all (like other stat grabbers). The specific use case AlexTheWhovian had in mind was counting discussions on (his look top right) talk archives.
I've got a sandboxed update ready to roll that's more efficient (or should be). Walking dog first.
Although there may be few urgent use cases, its existence allows its potential use. I argue (since I appreciate the apology) that if a method of obtaining data isn't actively or passively harmful, and no better' alternative exists, it has an intrinsic value of making the otherwise impossible possible - let the chips fall where they may. An analogy could be formed from any number of possibilities in other languages that are infrequently used, but the sky would fall if the option(s) weren't available i.e. handling edge cases with typically excluded snippets is better than being surprised or flat out denying. fredgandt 03:02, 25 March 2016 (UTC)[reply]
I had a thought whilst out walking with my dog, that this could facilitate statements like "Visit the Help desk where there are currently 22 active discussions" possible.
For regularly archived discussion pages, this offers a remote sense of the current state (approximately), which some might find assistive. fredgandt 05:24, 25 March 2016 (UTC)[reply]

Incorrect result

[edit]

@Fred Gandt: For the page User talk:AlexTheWhovian/Archive 14, at the time of this post, {{NUMBEROFSECTIONS|User talk:AlexTheWhovian/Archive 14}} is returning 12 (0), when it should be 10. Is this because of the level-2 headers in the first discussion surrounded be <pre> ... </pre> tags? Alex|The|Whovian? 03:15, 15 July 2016 (UTC)[reply]

Yep. It'll need to have a little bit of sophistication to exclude that kind of thing; I'll add it to my todo list. Fred Gandt · talk · contribs 05:35, 15 July 2016 (UTC)[reply]
@Fred Gandt: Any luck so far? No rush. Just wondering. Alex|The|Whovian? 12:08, 21 August 2016 (UTC)[reply]
Been and will continue to be somewhat busy. Will get around to it some day - probably - possibly! I think the sky won't fall if this doesn't work properly ;-) Fred Gandt · talk · contribs 18:02, 24 November 2016 (UTC)[reply]

Move discussion in progress

[edit]

There is a move discussion in progress on Template talk:NUMBEROF which affects this page. Please participate on that page and not in this talk page section. Thank you. —RMCD bot 04:46, 3 May 2020 (UTC)[reply]