Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Tales from Chyria
Search
Editing
Module talk:Hatnote
(section)
From Tales from Chyria
Namespaces
Module
Discussion
More
More
Page actions
Read
Edit source
New topic
History
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 Tales from Chyria may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
Chyria Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs