Jump to content

Module:Sandbox/Innesw/Infobox Australian place-upgrade/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Innesw (talk | contribs) at 11:27, 7 October 2024 (Update of intro, and new changes documented). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


This module is the existing Infobox Australian place template (as of March 2024) transferred from normal template syntax to a Lua module, and then further modified.

The original transfer from template to module syntax is here, and there is a testcases page comparing the two versions.

This upgrade version of the module includes more substantive changes to the behaviour of the template, including some additional parameters. It is still in development, and further changes are likely.

Some of the changes in behaviour actually involve changes to other modules that this one calls:

All of the changes detailed here are subject to further discussion - as individual items. It should not be assumed these changes have to be implemented or rejected as a whole set. There is a talk page specifically for that purpose.

New values for |type=

The following values for the |type= parameter are now recognised:

Use of the |type= parameter
Accepted value Description Effects Background
Colour
settlement A settled place too small to be a town.
  • the short description will be 'Settlement in ...'
  • the article will not be added to any auto categories
 
locality A rural locality, generally equivalent to |type=suburb.
  • the short description will be 'Locality in ...'
  • the article will be added to [[Category:Localities of /lga/]] if it exists
 
townandlocality Where the article is about a town, and a surrounding locality with the same name.
  • the short description will be 'Town and Locality in ...'
  • if |local_map=yes, and a map file named <name> + ', ' + <state> + ' UCL.map' exists in Commons:Data:, the local map will show both the locality (SAL) and the urban area (UCL)
    • the default caption will be "Locality (SAL) & Urban area (UCL)", but this will be overridden if |local_map_caption= is set
    • if the map file does not exist, just the locality will be shown (as at present), and there will be no default caption
  • the article will be added to category [[Category:Towns of /state/]], and to [[Category:Localities of /lga/]] if it exists
 

New Parameters

There are some additional parameters implemented:

Additional parameters
Parameter Available for |type= Description Notes Potential sources Values
native_name_footnotes all A reference demonstrating the Indigenous name Prerequisite parameters:
  • native_name
Wikitext (can contain links).
Best when used with <ref></ref> tags and a citation template.
local_map_caption all Caption for the local map Prerequisite parameters:
  • local_map
Plain text or wikitext.
logo_caption all Caption for the logo image Prerequisite parameters:
  • logo
Plain text or wikitext.

General Changes

  • if the module is called with no parameters, it returns an empty string
  • the parameter |short description= is no longer supported
  • both error messages for the non-existence of (or unsupported values for) |type= and |state= are in the heading of the infobox
  • new parameter native_name_footnotes
  • removes the difference between |type=protected and other types in the call to {{coords}}
  • fixes the response to 'flag' parameters (local_map, force_national_map, use_lga_map, relief, _noautocat) so 'no' = <blank>, any other value = 'yes' (implemented in Australian place map-upgrade)
  • the following values for |map_type= now have priority over the deprecated (but still implemented) parameters |force_national_map=, |use_lga_map= and |alternative_location_map= (implemented in Australian place map-upgrade)
    • |map_type=national or |map_type=australia - force the location map to be a map of Australia
    • |map_type=state - forces the location map to be the state map
    • |map_type=lga - forces the location map to be the map of the lga (as specified in |lga=)
    • |map_type=nomap - suppresses any location map
    • |map_type=(any other value) - assumes the provided value is the name of a specific map to use as the location map
  • the local_map (if shown) can have a caption, by setting |local_map_caption=
  • if |pop=<blank>, and therefore replaced by wikidata population data:
    • populations for a number of ABS geographies may be shown if they are in the wikidata linked to the article
    • a value for |pop2= (with |pop2_year= and |pop2_footnotes=) is still shown
    • a value for |poprank= is still shown
    • the citation references for populations in the infobox now integrate with references created by other calls to PopulationFromWikidata
    • if |type=cadastral or |type=protected, no population from Wikidata is ever shown
for details of these changes, see PopulationFromWikidata-upgrade
  • the space between the density and its reference (|density_footnotes=) has been removed
  • the logo (if shown) can have a caption, by setting |logo_caption=
  • the background colour of the headings for the climate and places-near sub-tables is now the same as the infobox header and the labels column

Changes to Categories

Auto Categories

  • when adding to the [[Category:Populated places established in /year/]]
    • |established= is now treated the same as |est=
    • an article is placed in the category no matter what the |type= value (instead of only for |type=lga)

Tracking Categories

  • obsolete parameters (alt, alt2, image_alt2, imagesize, image_size, imagesize2, image_size2, logo_alt, logosize) are now simply ignored. Any use of them will add the page to [[Category:Pages using infobox Australian place with unknown parameters]]
  • articles are added to a new category {{Pages using infobox Australian place with parameter issues}} if:
    • there are formatting errors in the template call
    • |type= or |state= are missing
    • population (|pop= or |pop2=) are set, but no related year (|pop_year= or |pop2_year=) is given
    • a parameter with an associated reference parameter (|..._footnotes=) is given, but the reference parameter is missing (eg: |pop= is given, but no |pop_footnotes=, or |elevation= but no |elevation_footnotes=)
    • there are density errors, ie: where |pop= and |area= are both given, but one of them is not a number (so a density cannot be calculated)
    • the automatic categories are explicitly suppressed , ie: |_noautocat= is not blank

Testing

This module can be tested with a call to {{Sandbox/Innesw/Infobox_Australian_place-upgrade}}, in general with any of the same parameters as the existing template.

There is a testcases page, comparing the output of this module with the existing template.

Issues for further discussion

  • whether a parameter for the Infobox is required that specifies an ABS geography for which a single population is shown (as opposed to the new default of possibly multiple populations)
  • whether |type=indigenouscommunity is worth adding to the infobox. If so, a number of steps to upload ILOC populations to Wikidata will be required.
  • what is the proper Wikidata population to show when |type=region. It is currently 'LGA', but maybe it should be 'SA3'.
  • should showing a value for |poprank= be suppressed unless |type=city
  • would it be better for each of the individual parameter issues (eg: a value without its ...footnotes) to have their own sub-category, with {{Pages using infobox Australian place with parameter issues}} just a container category