Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:TrainingPages/doc
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Module rating|protected}} This module is intended to accept the name of a page (defaulting to the page currently being displayed), look it up in an index of pages, step forward or backward by some number of pages (usually 1), and give back the name of the page at that position. Use {{Mlx|TrainingPages|''function''|''parameters''}} to invoke. For example: <code><nowiki>{{#invoke:TrainingPages|last_page|index=Wikipedia:Training/For students/Editing module index|page=Wikipedia:Training/For students/Where to get help|defaultpage=Wikipedia:Training/header}}</nowiki></code> yields: {{#invoke:TrainingPages|last_page|index=Wikipedia:Training/For students/Editing module index|page=Wikipedia:Training/For students/Where to get help|defaultpage=Wikipedia:Training/header}} == Functions== The available ''functions'' are: *next_page: the next page on the index list *last_page: the preceding page on the index list *page_number: the number the page indicated is in the list *total_pages: the total number of pages in the index *main: allows you to flip forward or backward an arbitrary number of pages == Parameters == (All parameters are available to every function, except ''displacement'' which only matters for main) * ''page'' is the page you are starting from (the one you're looking up in the index) ** if ''page'' is blank or omitted, the mw.title.getCurrentTitle() function is used to locate the current page. (So far as I know, this is always the page that matters, the one everything ultimately gets transcluded to, not the template or module) ** if ''page'' is a number and doesn't contain any text, the page that number of positions down in the index will be the base page used. With "main" and no displacement set, this returns the name of page#N. Otherwise you can have it return some number of pages off from that number, or the default page, as it would if the name of the page in that position had been entered as text. * ''defaultpage'' is the page to be returned if there ''is'' no next page, previous page, or page displaced by n in the index. Can be blank, in which case the module output will be blank if this happens. * ''index'' is the name of the index module with the list of all the pages. The pages should be in a list from beginning to end. There are three ways to format this: ** Index can be in ''module'' space (e.g. [[Module:TrainingPages/default index]]) in which case they must consist of ''return {'Name of first page','Name of second page','Name of third page''' ... etc.''}''. ** Index can be in some other space, not in module format, in which case it need merely contain a list of Wikilinks in double square brackets. Everything outside the brackets is ignored, and every link in double square brackets is counted. The only limitation is that in this version anything in double square brackets is taken as a link, even if nowiki applies or it is in other brackets or has a newline in it or something that prevents it from appearing as a proper link. You can put a pair of nowiki or noninclude tags between the two opening square brackets as a kludge to avoid having this happen, if need be. ** (If omitted, the index still defaults to [[Module:TrainingPages/default index]], so common tasks might be added to it. However, no provision has been made to prevent from paging from one set into another, so unless this only sees use in one consistent overall set of trainingpages that is a bad idea unless upgraded.) * ''displacement'' specifies how many pages to go forward or back in the ''main'' module. * ''noerr'' suppresses error messages if the index file can't be found; an empty string is returned. * ''anonymize'' - any nonblank value causes project specific pages (Wikipedia:) to be returned as Project: <includeonly> [[Category:Wikipedia training templates]]</includeonly>
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Error
(
edit
)
Template:Mlx
(
edit
)
Template:Module link expanded
(
edit
)
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Pp
(
edit
)
Template:Protection padlock
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Module:Arguments
(
edit
)
Module:Error
(
edit
)
Module:File link
(
edit
)
Module:Message box
(
edit
)
Module:Protection banner
(
edit
)
Module:Separated entries
(
edit
)
Module:TableTools
(
edit
)
Module:TrainingPages
(
edit
)