Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
YouTube Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module talk:Hatnote
(section)
Add topic
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Category handling == As I've been working on Lua-fying hatnotes, I've noticed that this module's <code>_hatnote()</code> function doesn't really support categories. Most of the time categories are either awkwardly concatenated in as strings, or appended after the call to <code>_hatnote()</code>. Moreover, this means each one needs to reimplement category handling, and there have been inconsistencies between the various templates/modules. For example, {{tl|About}} had some category-handling that I left out when migrating it to Lua (category was emptied, so not urgent, but…), and used a <code>_nocat</code> parameter, while the standard for [[Module:Hatnote]]-based templates seems to be <code>args.category</code>. Would anyone object to my adding a <code>category</code> argument to <code>_hatnote()</code>? I'd code it to accept a table (or <code>nil</code>), with category name keys (prevents duplicates) and <code>false</code> or category-key (string) values, and output a list of categories after the hatnote text. I'd also add a helper function <code>addCategory()</code> to add items to category tables, so that that wouldn't need to be reimplemented in each hatnote module. The main thing I'm hesitating on is that since <code>_hatnote()</code> doesn't itself get template arguments, templates would each need to include something like <code>yesno(args.category)</code> to toggle output—it's not self-contained. I'm not 100% sure of the approach and welcome suggestions on other ways to handle categories. <span style="white-space:nowrap;">{{[[User:Nihiltres|<span style="color:#233D7A;">Nihiltres</span>]] |[[User talk:Nihiltres|talk]] |[[Special:Contributions/Nihiltres|edits]]}}</span> 14:44, 11 May 2016 (UTC)
Summary:
Please note that all contributions to YouTube Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
YouTubeWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Module talk:Hatnote
(section)
Add topic