Template talk:Cat see also related words and phrases by language

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Errors[edit]

Pages using this template fill Category:Pages_with_script_errors with Lua error: too many expensive function calls. Error. Can this template be trimmed down to not rely on expensive functions? --Jarekt (talk) 00:56, 14 January 2021 (UTC)[reply]

@Jarekt: Indeed. I was hoping somebody more experienced with Lua could help me out with this. Would it be possible to distribute the calls over a few sub-templates in order to leverage their caching capabilities? I would like to keep current functionality and expand upon it. This template makes a world of a difference in reorganizing messy categories about signs and languages, but it is far from polished. --Iketsi (talk) 01:17, 14 January 2021 (UTC)[reply]
It is not a lua issue. I suspect that the problem is that the template calls multiple times sub-template {{Cat see also related words and phrases by language/row}} which uses "ifexist" function which is one of the "expensive" functions. Can we remove either the loop or rewrite {{Cat see also related words and phrases by language/row}} to stop using "ifexist"? I do not fully understand what is the purpose of the template so it is hard for me to understand why it requires multiple calls to "ifexist". --Jarekt (talk) 02:03, 14 January 2021 (UTC)[reply]
I've put the for loops in ifexist, so they don't run if the parent category does not exist. That should cut down on the expensive parser functions on most pages. I'll wait for the update to trickle through and see how much of an impact it's had. AntiCompositeNumber (talk) 18:14, 21 January 2022 (UTC)[reply]

Autocollapsed?[edit]

Is there any possibility of adding an option to this template to have it collapsed by default when the category is pulled up? Or to at least not add it to the language categories that will never see any of the redlinks turned blue? -Yupik (talk) 02:06, 4 June 2021 (UTC)[reply]

Hello @Iketsi and Yupik: good idea, I just implemented that (also on the doc-page), hope you are fine with that!? Regards --W like wiki good to know 04:33, 9 January 2023 (UTC)[reply]
Thank you! -Yupik (talk) 07:30, 9 January 2023 (UTC)[reply]