Template talk:Tech news text
Add topicHow to add a variable that can be adjusted weekly in the edition-page itself?
[edit]We have the recurring entry that outputs strings like:
- View all 19 community-submitted tasks that were resolved last week.
I want to be able to change that number ("19") via the Tech News edition pages directly, which embeds the string from here via {{safesubst:Tech news text/{{TRANSLATIONLANGUAGE}}|view all}}
I.e. If possible, I hope to be able to simply adjust a number in each week's edition -- perhaps it would look something like: {{safesubst:Tech news text/{{TRANSLATIONLANGUAGE}}|view all|19}}
I'm not sure how to adjust the content in this template, and within Tech/News/init, to do that; especially in a way that works properly with the "plural" translations function. Please could someone help? Possibly @Tacsipacsi?
(If it's not easily feasible, then I/other Tech News publishers, can just update that number on this template each week (as it doesn't invalidate the translations, so should be fine, IIUC). It's just a bit confusing/fragmented!)
Much thanks. Quiddity (WMF) (talk) 21:11, 5 December 2024 (UTC)
- Talk:Tech/News/2024/50#View all? IKhitron (talk) 22:09, 5 December 2024 (UTC)
- Haha! Great timing, thanks. Sorry I didn't notice that in my watchlist/email-tab before writing all this. :-) Quiddity (WMF) (talk) 23:33, 5 December 2024 (UTC)
- I've done some modification about this. I think it works. Cookai🍪 (💬talk) 01:04, 6 December 2024 (UTC)
- Do we need to change anything in the associated line at Tech/News/init which (IIUC) prefills the translations when they are each initialized? Or will that new setup (thank you!) "just work"(TM) as it is? Quiddity (WMF) (talk) 19:33, 6 December 2024 (UTC)
- (I'm not quite sure how staffs initialize new issues.)
- Sorry for the confusion, the number needs to be filled manually when initializing.
- I recall back then the MediaWiki train also had a number that changed every week. Maybe add a placeholder like that? Cookai🍪 (💬talk) 05:18, 7 December 2024 (UTC)
- We initialize each new edition, just by clicking on the "Create next" link in the yellow-template at the latest edition, e.g. you can preview by clicking at Tech/News/2024/51 currently. It just prefills the new page with the contents of Tech/News/init.
- The part where I get uncertain, is what order the safesubst-ing all happens in!
- And yeah, a placeholder would be fine, as long as it works with the
{{plural}} and {{formatnum}}
(which I also semi-understand, but am uncertain about the nuances of...). I.e. I imagine it might break the output if we used a placeholder of "NNN", which I was using previously! But "20" or something would be good. Quiddity (WMF) (talk) 19:59, 7 December 2024 (UTC)
- Do we need to change anything in the associated line at Tech/News/init which (IIUC) prefills the translations when they are each initialized? Or will that new setup (thank you!) "just work"(TM) as it is? Quiddity (WMF) (talk) 19:33, 6 December 2024 (UTC)