No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
Source #1: {{{1}}}/version {{#ifexist:{{{1}}}/version|exists and is expected to be in version {{{2|not specified}}}|does not exist}} | |||
Source #2: {{{3}}}/version {{#ifexist:{{{3}}}/version|exists and is expected to be in version {{{4|not specified}}}|does not exist}} | |||
Source #3: {{{5}}}/version {{#ifexist:{{{5}}}/version|exists and is expected to be in version {{{6|not specified}}}|does not exist}} | |||
{{#ifexist:{{{1}}}/version | {{#ifexist:{{{1}}}/version | ||
| {{#ifeq: {{{{{1}}}/version}} | {{{2|}}} | | {{#ifeq: {{{{{1}}}/version}} | {{{2|}}} |
Revision as of 09:58, 3 June 2015
this template checks the validity of a page that is based on (or translated from) content hosted in other pages.
To check the validity, the template retrieves the version number of each source page and compares it with an expected version number.
The template allow to declare up to 3 source pages with their expected version number.
If one of the source page is significantly updated, resulting in a version change, the template will detect the difference with the new version of the source page and the old expected version and display a warning banner and a red traffic light in the page title line. Otherwise, if validated, a green traffic light is displayed in the page title line
Syntax
{{ UpToDate |source page #1| expected version for source page #1 |source page #2| expected version for source page #2 |source page #3| expected version for source page #3 }}
The second and third line above are optional, according to the number of source pages that are used to build the content of the current page.
Example
If a page has been built by aggregating content from 3 different pages, Alpha, Beta and Gamma, respectively in version 1.3, 2.2 and 1.0, the following template should be added at the top of the body.
{{ UpToDate |Alpha| 1.3 |Beta| 2.2 |Gamma| 1.0 }}
Future improvement
- The current template currently works at a page level for the source page and does not identify change at the section level only.
- If a change occurs only in a section of the source page, the version increase will impact the whole page and trigger all templates pointing to this source page, even if the destination page is not using the modified section.
- The template (and the whole mechanism) should be improved to include a section per section validity check.
- The current template has no recursive capabilities.
- if the source page is transcluding a content from another page, a change on this other page won't trigger a version increase on the source page, thus won't trigger the template.
- This will require further investigation to find a efficient way to propagate a change through transclusion.
The above documentation is transcluded from User:Deeploz/Template:UpToDate/doc. Please add categories to the /doc subpage. Subpages of this page. |
Last time is has been evaluated : 27 12 2024 at 07:40.