Template:UI/guides library/entry

From Miniscope
Jump to: navigation, search

Row partial for Template:UI/guides_library. Called by the library's format=filtered ask in positional mode — args come in the order printouts are declared on the #ask call (SRF's filtered list view doesn't shuffle filtered columns to the front).

Positional args:

  • {{{1}}} — page name (from mainlabel=page)
  • {{{2}}} — Has name (display title)
  • {{{3}}} — Has date (raw ISO; for kicker line)
  • {{{4}}} — Has description (lead paragraph)
  • {{{5}}} — Has guide topic (sidebar facet + row chip)
  • {{{6}}} — Has guide format (sidebar facet + row chip)
  • {{{7}}} — Has workflow stage (sidebar facet only;
 not rendered to keep the row scannable)
  • {{{8}}} — Has audience level (sidebar facet + row chip)
  • {{{9}}} — Has target audience (sidebar facet only)
  • {{{10}}} — Has project (sidebar facet only)

Renders a row card with:

  • Title (linked) + Guide-format chip beside it (Tutorial /
 Assembly guide / Quick start / …)
  • Kicker line — Has date (if set) + Has audience level (if set),
 small and muted
  • Lead paragraph — Has description (truncated by CSS line-clamp on
 the parent class so long descriptions don't bloat the row)
  • Topic chip strip below the lead — accent-bordered, multi-valued

The workflow-stage, target-audience, and project facets stay sidebar-only — they're useful filters but adding chips for all of them clutters the row. Same trade-off Publications + FAQs libraries make for their lower-priority facets.

Why positional, not named

Same SRF list view named args=yes rationale documented in Template:UI/publications_library: positional args dodge the ?-prefixed param names SRF generates in named mode. Printout aliases are still set on the parent #ask because SRF uses them as the filter sidebar labels.

Main-namespace filtering

The library passes userparam= through the #ask. When that's empty (the default), this template's outer #if suppresses the entire row for any page outside the main namespace — admin-namespace guides (Workshop admin:…) live under Category:Guide for taxonomy but stay out of the public directory. When the caller sets include_non_main=1 on the parent template the userparam string is non-empty and the gate opens.

Same pattern Template:UI/recent_activity_feed/row uses. The suppression wraps the entire output — no empty div, no whitespace — so SRF's filtered-format DOM doesn't see a placeholder row for hidden guides. (Facet sidebar aggregation by SRF still indexes the raw printouts, so admin-only facet values may still appear as filter chips; clicking such a chip filters the visible list to empty. Acceptable cruft.)