Editing
Widget:ArticleSpawner/doc
Jump to navigation
Jump to search
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!
'''[[Widget:ArticleSpawner|<nowiki>{{#widget: ArticleSpawner}}</nowiki>]]''' creates a form or button that preloads wikitext from [[:Category:preload templates|preload templates]] into the edit window of a new page, and populates the preload template with custom content. This extends (and potentially replaces) the functionality of the [[mediawikiwiki:InputBox|InputBox]]-driven {{tl|ArticleSpawner}} template. == Usage == <pre> {{#widget: ArticleSpawner | type = | summary = | title = | showtitle = | param.A Key = | param.Another Key = ... | hiddenparam = | hiddenparam = ... | submit = }} </pre> All fields are optional. ; type ''(optional)'': Hidden parameter that defines the preload templates to load into the edit window and content above it. Default is blank. :: See {{tl|ArticleSpawner/doc}} for details on PathfinderWiki preload templates and content. ; summary ''(optional)'': Hidden parameter that sets the text to preload in the editing tool's summary field. Default is blank. ; title ''(optional)'': Name of the article to edit or create. Default is blank. :: If you enter a '''title''' value and '''showtitle''' is not passed, this parameter's value fills the ArticleSpawner form's "Article Title" field. :: If you enter a '''title''' value and '''showtitle''' is {{xt|no}}, the value is passed as a hidden parameter; there's no Article Title field, and clicking Submit creates the article using this value as the title. ; showtitle ''(optional)'': If {{xt|no}}, hides the Article Title field. Set to {{xt|no}} to create a standalone ArticleSpawner button. ; param.(key name) ''(optional; can declare multiple times)'': Creates a form field with the {{xt|(key name)}} as the field's label and fills the field with the parameter's value. The value can be blank; if you don't pass a key name, it defaults to an integer. :: All '''param'''s are declared in the order you pass them, but before any '''hiddenparams''' regardless of the order they appear in the template—this is important as the preload template applies values in sequential order, so {{xt|$1}} on the preload template is the first '''param''' declared in the widget, {{xt|$2}} is the second, etc., and then the first '''hiddenparam''' declared in the widget follows in the preload template's numeric sequence. ; hiddenparam ''(optional; can declare multiple times)'': Passes a value as a preload parameter without creating a form field. ; submit ''(optional)'': Changes the text that appears on the submit button. Default is {{xt|submit}}. == Example == === No parameters === <pre> {{#widget: ArticleSpawner}} </pre> {{#widget: ArticleSpawner}} An ArticleSpawner widget with no parameters displays an Article Title field and Submit button; filling the field and clicking submit is equivalent to clicking a link for an article with the same title. === Basic parameters === <pre> {{#widget: ArticleSpawner | title = Squealy Nord | submit = Create an article }} </pre> {{#widget: ArticleSpawner | title = Squealy Nord | submit = Create an article }} You can fill the Article Title field and Submit button with custom text. Note that the user can still edit the title. === Button with no fields === <pre> {{#widget: ArticleSpawner | title = Squealy Nord | showtitle = no | submit = Create the "Squealy Nord" article now! | summary = Finally created the Squealy Nord article }} </pre> {{#widget: ArticleSpawner | title = Squealy Nord | showtitle = no | submit = Create the "Squealy Nord" article now! | summary = Finally created the Squealy Nord article }} This button creates an article using [[Squealy Nord]] as the tile, and fills in the edit summary. === Preload template === <pre> {{#widget: ArticleSpawner | type = Biography | summary = New real-world person article | submit = New biography }} </pre> {{#widget: ArticleSpawner | type = Biography | summary = New real-world person article | submit = New biography }} When the user fills in a title and clicks the "New biography" button, it takes them to the article page, applies the {{tl|ArticleSpawner/Biography}} preload template to the edit box, and displays the {{tl|ArticleSpawner/Biography/doc}} content above the edit box. === Parameterized preload template === <pre> {{#widget: ArticleSpawner | type = Biography | summary = New real-world freelancer article | param.Name = | param.Navbox target = freelance | param.Role category = [[Category:Authors]] | hiddenparam = [[Category:Freelance contributors]] | hiddenparam = Freelancer | submit = New biography }} </pre> {{#widget: ArticleSpawner | type = Biography | summary = New real-world freelancer article | param.Name = | param.Navbox target = freelance | param.Role category = [[Category:Authors]] | hiddenparam = [[Category:Freelance contributors]] | hiddenparam = Freelancer | submit = Freelancer biography }} For preload templates with preload parameters ({{xt|$1}}, {{xt|$2}}, {{xt|$3}}, etc.), clicking the "Freelancer biography" button opens the article page, preloads the {{tl|ArticleSpawner/Biography}} template and fills the preload parameters with the '''param''' and '''hiddenparam''' values in order ('''param.Name''' replaces {{xt|$1}}, '''param.Navbox target''' replaces {{xt|$2}}, '''param.Role category''' replaces {{xt|$3}}, the first '''hiddenparam''' replaces {{xt|$4}}, etc.), and displays the {{tl|ArticleSpawner/Biography/doc}} content above the edit box. Note that if the '''hiddenparam'''s were placed before the '''param'''s, they would '''''not''''' be applied before the '''param'''s. The widget processes all '''param'''s in order first, ''then'' all '''hiddenparam'''s in order. == TODO == * Handle labels more semantically. * Allow for dropdown options. * Provide field validation options. * Relax param/hiddenparam ordering.
Summary:
Please note that all contributions to 2d4chan 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
2d4chan:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Tl
(
edit
)
Template:Xt
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information