Template:Scroll page/doc

Purpose
This template checks whether a proper data storage page (see Template:Scroll data documentation) is defined for the scroll page it is on.

If something is wrong, it displays a message box with an error message. If the data page is valid, it displays nothing. Possible errors are:
 * the data page does not exist,
 * the data page exists but it outputs some characters (including spaces and line breaks) when it is transcluded,
 * the data page doesn't initialize data variables (probably because Scroll data is missing or its parameters are wrong), or
 * the data page can't be checked for validity because data was already initialized before this template (see Usage).

Usage
This template must be included, once, at the beginning of a scroll page. Also, each scroll page should have a Scroll page tag – even if it already has a valid data storage page, because if it later becomes invalid, this template will easily let contributors know it.

It is important that this template is included at the beginning of the page, because it requires data to be uninitialized to perform all its checks. If it displays an error message saying that the scroll data was already loaded, that means that another template which uses scroll data is included earlier and you should move Scroll page to the top. Moreover, this template initializes data while performing checks. This is the reason why it should only be included once, otherwise every template call after the first would display the previous error message.

By default, this template considers that the data storage page is the  subpage of the scroll page. However, the  parameter can be used to specify an unconventional data storage page.

Blank template
To use this template, you can copy and paste the following code to the scroll page you want to use it on.

Preloading
It is also possible to preload a new scroll page with this template and its usual structure, along with some instructions, by entering the scroll page name in the below text field and click the button.

See Template:Scroll page/preload for more information.

Regular example
Below example shows how the template is meant to be used (i.e. at the beginning of a page).

Unfortunately, it is hard to show what the template displays, partly because most of the time it won't display anything.

Example with a specific data page
Below example shows how to use the template when the data storage page is not the  subpage.

Here, Template:Scroll data/doc is considered to be the data storage page, but it isn't a valid one. This is the reason why an error message box is displayed.

Result:

Related templates

 * Scroll data
 * Scroll page/preload