Editing version 3 of page APIs_RegSpecialPage (this is the most recent revision)
Note: This page is defined as a special page, and as such its final state may be different from what you see here.
Use template:
None
API_Template
DevTrack_Template
Version_Template
==Subroutine Name
**RegSpecialPage**
==Explanation and Usage
This will register a "special page." It allows you to associate a subroutine with a page name. Every time the page you associate is loaded by Aneuch, whether or not the page actually exists in the database, the associated subroutine is called. The output of the subroutine, if any, is appended to the bottom of the existing page content (if any).
This is used internally by Aneuch to show recent changes, and to handle the discussion pages (see Examples below).
==Syntax
**`RegSpecialPage(PageName, Subroutine)`**
==Options
**PageName** - This is a required option. Pass the name of a page here, or optionally you can use a regex here to match all pages with a certain pattern.
**Subroutine** - This should be the subroutine that is called when the page name you specify is loaded. Must be entered in this format: **`\&SubroutineName`**
==Examples
These are actual examples from the Aneuch source code:
**`RegSpecialPage('RecentChanges', \&DoRecentChanges);`**\\This registers the page 'RecentChanges', and will call the subroutine DoRecentChanges every time the page is loaded.
**`RegSpecialPage("$DiscussPrefix.*", \&DoDiscuss);`**\\This registers any page which begins with $DiscussPrefix, which defaults to 'Discuss_', and will call the subroutine DoDiscuss every time one of these pages is loaded.
This page is a template
Summary:
User name:
Upload a file
By contributing to this wiki, you acknowledge that you waive your right to claim copyright of your individual contributions. The text of this site is uncopyrighted and released to the public domain.
Show markup help Styling **bold **, //italic //, __underline __, --strikethrough--, `teletype ` Headers = Level 1 =, == Level 2 ==, === Level 3 ===, ==== Level 4 ====, ===== Level 5 ===== (ending ='s optional) Lists * Unordered List, # Ordered List, ** Level 2 unordered, ### Level 3 ordered (up to 5 levels, NO SPACES IN FRONT) Links [[Page]], [[Page|description]], [[http://link]], [[http://link|description]] Images {{image.jpg}}, {{right:image.jpg}} (right aligned), [[link|{{image.jpg}}]] (image linked to link), {{image.jpg|alt text}} Extras ---- (horizonal rule), ~~~~ (signature)