Template:Firehose row: Difference between revisions
Show running time and a direct audio link; both are already recorded (via update-page on MediaWiki MCP Server) |
Fix #expr: round is an infix operator, not a function (via update-page on MediaWiki MCP Server) |
||
| Line 23: | Line 23: | ||
links, which defeats <code>#titleparts</code> and makes the episode link | links, which defeats <code>#titleparts</code> and makes the episode link | ||
impossible to relabel. | impossible to relabel. | ||
Note that <code>#expr</code> takes <code>round</code> as an infix operator — | |||
<code>x / 60 round 0</code>, never <code>round(x / 60, 0)</code>. The function | |||
form parses but fails at render time with "Unexpected round operator", which is | |||
the sort of error you only see if you look at the page. | |||
Laid out with divs rather than table markup on purpose: this template's output | Laid out with divs rather than table markup on purpose: this template's output | ||
| Line 41: | Line 46: | ||
</div> | </div> | ||
<div style="flex:0 0 auto; text-align:right; font-family:monospace; font-size:.78em; color:#6b7566; white-space:nowrap;"> | <div style="flex:0 0 auto; text-align:right; font-family:monospace; font-size:.78em; color:#6b7566; white-space:nowrap;"> | ||
<div>{{{4|}}}{{#if:{{{6|}}}| · {{#expr: | <div>{{{4|}}}{{#if:{{{6|}}}| · {{#expr: {{{6}}} / 60 round 0}} min}}</div> | ||
<div>{{#if:{{{5|}}}|[{{{5}}} episode]}}{{#if:{{{7|}}}| · [{{{7}}} audio]}}</div> | <div>{{#if:{{{5|}}}|[{{{5}}} episode]}}{{#if:{{{7|}}}| · [{{{7}}} audio]}}</div> | ||
</div> | </div> | ||
</div></includeonly> | </div></includeonly> | ||
Revision as of 18:28, 13 September 2026
Renders one episode row for Template:Firehose. Not intended to be called
directly — it is passed to #ask as template=Firehose row.
Parameters arrive positionally, in the order the printouts are declared in Template:Firehose:
- page title of the episode
- Has podcast
- Has topic
- Has air date
- Has episode url
- Has duration, in seconds
- Has audio url
Every topic is linked, through Module:Firehose links, which splits a multi-topic value so each name gets its own link rather than one broken one. That linking is the whole point: it is what makes the episode appear on the page of each person, band or place it is about.
The query runs with link=none, so every value arrives as plain
text. That is deliberate: Semantic MediaWiki otherwise hands over pre-rendered
links, which defeats #titleparts and makes the episode link
impossible to relabel.
Note that #expr takes round as an infix operator —
x / 60 round 0, never round(x / 60, 0). The function
form parses but fails at render time with "Unexpected round operator", which is
the sort of error you only see if you look at the page.
Laid out with divs rather than table markup on purpose: this template's output is assembled inside a parser function call, and pipe characters in that position are a reliable source of grief.
The name has no slash in it deliberately. Pages with a slash in the title cannot currently be read or edited through the REST API, because Apache rejects the encoded slash before MediaWiki sees it — so a subpage here would be a template no bot could ever fix.