Template:Browse/AreaCard
More actions
Usage
Card template fed by SMW format=template queries on the Browse by growing area page. Renders one card per growing area that at least one accession names in Has growing area.
Receives two positional parameters from SMW:
{{{1}}}— area page name (mainlabel){{{2}}}— bare image filename from?Has image=imageprintout. Empty if no image set.
Card click target is the area browse subpage at Browse by growing area/{Area}, not the main area article. The subpage shows the accession listing and links the main article from its own lead when that article exists.
If the subpage has not been created, the card falls back to a Special:Ask listing of that area's accessions, so an area that arrives with a new accession batch never leads to an edit form. The #ifexist check also records the missing subpage in Special:WantedPages. To fill the gap, create Browse by growing area/{Area} containing {{Browse/AreaSubpage|area={Area}}}. Leave an area on the fallback while its stored name is under review, for example a district, river or village name in the area field, so that no subpage is created at a title that is about to change.
The count label uses PLURAL, so an area with one accession reads "1 accession".
The line under the title names the growing region or regions of the area's accessions (the inverse of Has growing region over those accessions), so areas with similar names can be told apart.
Outer #ask query needs link=none so values arrive as bare text rather than wikilink-formatted strings.
The overlay link text is the area name. CSS hides it visually; screen readers announce it.
Image is requested at 1024px width for retina sharpness; CSS scales it to fill the 16:10 container. The image comes from the area article's Has image. Cards for areas without an article, or whose article has no image, show the placeholder colour.
Template wikitext is on a single line by design.
Calling query
The query takes the inverse of Has growing area over the accessions, so the grid lists exactly the areas that have accessions, whether or not the area article exists yet. The subquery is limited to Category:Accessions because news items also set Has growing area.
{{#ask:[[-Has growing area::<q>[[Category:Accessions]]</q>]]
|?Has image=image
|format=template
|template=Browse/AreaCard
|sort=
|limit=500
|link=none
|searchlabel=
}}