Template:Category/Forum/sub forum card

From Miniscope
Jump to: navigation, search

Row renderer for the sub-forum KPI grid in Template:Category/Forum.

Invoked via SMW's format=template with named args=yes and link=none, so the sub-forum's full page name arrives via (from mainlabel=Page) as a bare title rather than a wikilink.

Emits one clickable KPI card per child forum:

  • Value — count of topic subpages under the child's talk-namespace
 counterpart, computed via the same namespace + LIKE-pattern split as the
 parent's topics query (Talk:+ ~*.../*).
 Talk/... derive the
 talk namespace and bare page name from the child's full title, so this
 works for any subject/talk pair without hardcoding "Forum".
  • Label — the bare page name (no namespace prefix), so a sub-forum
 at Forum:Hardware renders as just "Hardware" on the card.
  • Link — the sub-forum landing page; the whole card is clickable.

Markup is inlined here (rather than calling Template:UI/kpi_card) because some SMW configurations don't transclude nested templates reliably from inside a format=template row template — the same caveat documented on Template:Category/Dashboard/sub_dashboard_card.

Named args:

  • — the sub-forum page (named arg, from SMW's
 mainlabel=Page; bare full title when called with
 link=none). Falls back to positional 
 for direct template invocations like
 {{Category/Forum/sub_forum_card|1=Forum:Hardware}}.
  • Description — value of ?Has description=Description
 from the parent ask. Currently unused on the card face; kept for future
 tooltip / sub-line use.