Statistics Explained

Archive:Tutorial:Templates to generate stable external links

This tutorial explains the difference between individual full external links and template-generated stable ones and the advantages of using the latter. It describes the different existing templates to generate external links and how to maintain and update them.

Individual versus template-generated stable links

Links and templates

Articles and glossary pages in Statistics Explained contain many external links[1], either in the text or more often in 'portal' sections like 'Further (Eurostat) information' or 'External links'. Many of these lead to subsites with a standardised url, consisting of two elements: a generic invariable part, and a short and coded variable part. For instance (code in bold) the Eurostat publication product page http://ec.europa.eu/eurostat/product?code=KS-FO-12-001 or the Eur-Lex legal text overview page http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32011R0692:EN:NOT.

A link to this kind of standardised url can be encoded in two different ways:

  • individually, like any other external link (e.g. [http://ec.europa.eu/eurostat/product?code=KS-FO-12-001]);
  • or via a template which generates the invariable part of the url, combined with a manually inserted code (and label to be displayed); e.g. 'Template:Publication' combined with code 'KS-FO-12-001' and label 'International trade and foreign direct investment - 2013 edition': {{Template:Publication|code=KS-FO-12-001|title=International trade and foreign direct investment - 2013 edition}}.

Advantages of template-generated stable links

The use of a template-generated stable link instead of an individually code one has two major advantages:

  • for contributors it is easier and more efficient: for most template-generated external links there is wikitext editing button, so only the code and the text to be displayed have to be added;
  • for Statistics Explained site managers' it is hugely more efficient if something changes in the structure of the standard url: only one template page has to be changed, instead of hundreds or thousands of individual links in numerous articles.


Stable and unstable URLs

Direct hyperlinks to pages of the Eurostat website and especially to the data tree are useful for linking and bookmarking purposes, for both internal and external users. For this reason, efforts have been made to create stable links within the website. Two types of stable links need to be distinguished:

  • to main chapters of the website, including dedicated sections;
  • to data sets (both tables and data base) and publications, via the data code.

Links to data sets and publications via the data code are automatically converted by the website into internal links. Be aware that these internal links are unstable.

Links to deleted or renamed data sets via the data code can automatically be redirected to the closest new data set (see below).

Links to all other parts of the website not mentioned above are unstable and should not be used for linking and bookmarking purposes. In the data tree, only the links to the main branches (those referred to in dedicated sections) and to the individual data sets are stable.

Templates to generate stable links

Publication product page

Template:Publication

  • [http://ec.europa.eu/eurostat/product?code=<data code>&mode=view]
(opens pdf)
  • [http://ec.europa.eu/eurostat/product?code=<data code>]
(shows product page)
Examples

Link to data set (tables and data base)

  • [http://ec.europa.eu/eurostat/product?code=<data code>]
(shows product page)
  • [http://ec.europa.eu/eurostat/product?code=<data code>&mode=view]
(by adding the parameter '&mode=view', the data set is shown instead of the product page)
  • [http://ec.europa.eu/eurostat/product?code=<data code>&mode=view&language=de]
(by adding the parameter '&language=de' or '&language=fr', the German or French version is shown instead of the English one)
Examples

Link to main table tree

[http://ec.europa.eu/eurostat/web/<dedicated section>/data/main-tables]

Example National accounts

Link to data base tree

[http://ec.europa.eu/eurostat/web/<dedicated section>/data/database]

Example Prices (HICP)

Link to dedicated section

[http://ec.europa.eu/eurostat/web/<dedicated section>/overview]

Example Labour market

Where

  • <dedicated section> = exact name of the dedicated section within the Eurostat web-link (including, for instance, dashes). This name does not always correspond with the name of the dedicated section on the statistics page (because it may have dashes or be abbreviated) - open a dedicated section to check the link name.
  • <data code> =
    • for data sets: code as seen in the data tree (if logged in), or code as seen on the product page;
    • for publications: product code as seen on the product page.

ESMS metadata file

{{Template:Esms|code=filename|title=esms title}} (ESMS metadata file — filename)

Example Waste statistics
  • Template:Esms|code=env_wasgt_esms|title=Waste statistics (ESMS metadata file — env_wasgt_esms)

Eur-LEX texts: Regulations, Directives,

Template:EurLex

{{{title}}}

Maintenance of links

Links must remain as stable as possible. Therefore the following operations should be avoided:

  • renaming dedicated sections;
  • renaming Statistics Explained articles.

If renaming is unavoidable, all corresponding links on website including those in Statistics Explained need to be adapted accordingly.

For access to data sets, a redirect system (Code'm) has been implemented which automatically converts old data codes into new data codes. The conversion tables are managed by the unit responsible for the reference data base. Any request for redirects should be sent to ESTAT REFERENCE DBA.

When reorganising data sets, it is strongly recommended to re-use the same data codes provided that the new tables are sufficiently similar to the old ones. For detailed advice, contact ESTAT REFERENCE DBA or ESTAT MAIN TABLES.

See also

Notes

<references>

  1. 'External' refers to links leading outside Statistics Explained, this also includes links to the Eurostat portal!