Template:Subjects/allbooks/doc

This template processes a request to add the current page to the allbooks category associated with a given subject. It isn't added unless the allbooks category page exists; this is because allbooks categories should not appear on a book main page, and if they exist they're probably hidden, but if they don't exist they're sure to be visible as a redlink.

Usage
There are three required parameters, one of which must be non-blank. This template first attempts to verify the existence of the allbooks category page by checking that the transcluded content of the category page is parsable. If so, there is presumed to be no problem, and this page is added to the category. If that test fails, expensive parser function {{#ifexist:}} is used to determine whether the page exists; if it exists, this page is added to the category. However, even if added, failure of parsable indicates a problem, so if  is non-blank, one or another error message is generated.
 * &mdash; The name of the subject of the associated allbooks page.
 * &mdash; The name of the previously visited subject page, if any, which provided the value for ; may be blank.
 * &mdash; If non-blank, diagnostic messages are provided when errors are detected, together with suggestions to fix the problem and buttons to act on the suggestions.