User:Davidgothberg/Range/doc

This is the meta-template.

It is used to show only parts of a list of items. This means that an article can call for instance a navbox with a year range as parameter, and only those items within the year range in the navbox will be visible. Thus keeping the navbox display small, but still you only need to manage one single navbox for the whole list.

Note that the "years" here can be any kind of number, so this template can be used for other ranges too. Even negative numbers and real numbers such as  work fine.

Usage
This template takes four parameters. The "item" is only shown if the "item year" is within the year range. Like this:



If "start year" is left empty them the item is shown. This is usually the case when a navbox that uses this template is viewed on its own template page. Then we want to see all items. Like this:



Here is an example how this template can be used inside a navbox list:

Note that there must be no newline between the end braces of one and the begin of the next one. But there may be spaces.


 * For example:
 * Produces:
 * While:
 * Produces:

Technical details
This template has built-in linewrap handling.

Under construction
This is still being tested. Do not use it yet!

The code now seems fully functional. What is lacking is the documentation of the "separator" feature and the convenience templates range·, range• and so on.

For usage examples see the User:Davidgothberg/Range/testcases subpage.

--David Göthberg (talk) 11:25, 25 May 2008 (UTC)

Category:Article shared content templates