User:Deeploz/Template:UpToDate View history

No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifexist:{{{1|}}}/version|{{#ifeq: {{{{{1|}}}/version}}|{{{2|}}}|{{#ifexist:{{{3|}}}/version|{{#ifeq: {{{{{3|}}}/version}}|{{{4|}}}|{{#ifexist:{{{5|}}}/version|{{#ifeq: {{{{{5|}}}/version}} |{{{6|}}}|{{User:Deeploz/Tests/UpToDate/green}}| {{User:Deeploz/Tests/UpToDate/red|{{{5|}}}}}}}|{{User:Deeploz/Tests/UpToDate/green}}}}|{{User:Deeploz/Tests/UpToDate/red|{{{3|}}}}}}}|{{User:Deeploz/Tests/UpToDate/green}}}}| {{User:Deeploz/Tests/UpToDate/red|{{{1|}}}}}}}|}}</includeonly><noinclude>{{doc}}</noinclude>
<includeonly>{{#ifexist:{{{1|}}}/version|{{#ifeq: {{{{{1|}}}/version}}|{{{2|}}}|{{#ifexist:{{{3|}}}/version|{{#ifeq: {{{{{3|}}}/version}}|{{{4|}}}|{{#ifexist:{{{5|}}}/version|{{#ifeq: {{{{{5|}}}/version}} |{{{6|}}}|{{User:Deeploz/Template:UpToDate/green}}| {{User:Deeploz/Template:UpToDate/red|{{{5|}}}}}}}|{{User:Deeploz/Template:UpToDate/green}}}}|{{User:Deeploz/Template:UpToDate/red|{{{3|}}}}}}}|{{User:Deeploz/Template:UpToDate/green}}}}| {{User:Deeploz/Template:UpToDate/red|{{{1|}}}}}}}|}}</includeonly><noinclude>{{doc}}</noinclude>

Latest revision as of 12:20, 3 July 2015

Documentation[view] [edit] [history] [purge]

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.