Template:Infobox election/showblocks

From Wikidata
Jump to navigation Jump to search


Documentation icon Template documentation[[{{fullurl:

Technical documentation about operation of {{Infobox election}} and its sub-templates.

Inventory and relationships between subtemplates[edit]

Workflow
infobox election /core /prepare /showblocks
Gather basic information for the process

Determine type of election (/type_election)

Determine "today" in relation to the election period (/moment)

Perform the process according to type of election and time Calculates and prepares information from boxes with result bars
It calls to /prepare_prev_results
Builds box presentation structure with results
/prepare_multi
In multi-voting processes, this sub-template makes the various calls to /prepare for each candidate.


  • Manage configuration settings. If any WP wanted to use a language version of these parameters it would be in this template where the conversion should take place and avoid having to modify any other sub-templates.
  • template:Infobox election/type_election: Determine the type of election. A) indicated manually in type_election, B) using the voting system (P8196), C) deduced according to certain contents of the items involved.
  • Obtain and transfer a set of values that require a complex code and are later widely used in other sub-templates.
  • template:Infobox election/moment:Determines whether the day the infobox is viewed is before, during the campaign, or after election day. It allows to show small differences in content.
  • template:Infobox election/core:Retrieves the information from the P726, determines and invokes the processes to be performed according to the type of choice and the current time. All content except the result boxes is placed directly from this template with the {{InfoboxFrame}}.
  • template:Infobox election/prepare:Based on the information of the candidate who provides /core, this sub-template complements it with the results of P991, calls /prepare_prev_results to makes the differential calculations with the data of the previous election and transfers it to /showblocks
  • template:Infobox election/prepare multi: In multi-voting processes, make the various calls to /prepare for a candidate, adding information regarding each election.
  • template:Infobox election/showblocks: Prepares the graphical representation of the boxes with results: of electoral participation and of results of the candidates, Any aspect relative to the format, icons, colors and layout of this part of the infobox is managed from here.| action=edit&preload=Template:Documentation/preload }} create]]