Community Central
Community Central
(+ interlanguage: de)
(Uncapitalize the Fandom name. We are not in between 2017 and 2019.)
Tag: Help
(27 intermediate revisions by 19 users not shown)
Line 1: Line 1:
  +
{{TOCright}}
__NOTOC__ __NOEDITSECTION__
 
[[File:Preload.png|thumb|350px]]'''Preloaded templates''' can pre-populate a new wiki page with instructions, page structure, or content. This may be easier for new users to understand than an empty edit box, and can help them create pages that meet the wiki's style guidelines.
+
'''Preloaded templates''' can pre-populate a new page with instructions, page structure, or content. This may be easier for new users to understand than an empty edit box, and can help them create pages that meet the community's style guidelines.
  +
: '''''The following page describes an advanced method for managing page creation, and one that mostly applies to the [[Help:Source edit mode|source editor]]. For the basics of page creation, please see [[Help:New page|this page]].'''''
 
This is an advanced method for managing page creation. For simpler methods, see [[Help:CreatePage]].
 
 
==Step-by-Step==
 
   
 
== Step by step ==
 
Let's assume you want to create a new article page called "Bobby". You want that page to include an infobox and a few section headers, because you've decided that all of your character pages should begin this way. You also want to set things up so that other editors can start new character pages the same way, too.
 
Let's assume you want to create a new article page called "Bobby". You want that page to include an infobox and a few section headers, because you've decided that all of your character pages should begin this way. You also want to set things up so that other editors can start new character pages the same way, too.
   
Here's how you can do that with Preloaded Templates.
+
Here's how you can do that with preloaded templates.
  +
[[File:Preload.png|thumb|250px|Preloaded templates in action]]
   
==='''Phase One: Create the Template'''===
+
=== Create the template ===
  +
* Create a new page on your community in the ''Template'' or ''Project'' namespace. In our example, you can call this page '''Template:Character/preload'''. It should be classified as "Design" if it is in ''Template:''. The advantage to placing it in Project (also known as the wiki's name in the namespace, such as '''Game of Thrones Wiki:Character Page''') is that it will not be a suggestion in the various editors.
 
* Edit this template to include the content and template calls you want to appear when you create a new page.
 
* Save your preload template.
   
  +
=== Create the page creation tool ===
* Create a new page on your wiki in the Template namespace. In our example, you can call this page '''Template:Character'''.
 
   
 
There are three common ways to approach this part:
* Edit this template to include the content you want to appear when you create a new page. For example, if you're including an infobox and a few headings, you might want to enter the following:
 
 
==== Method one: input boxes ====
 
 
This method creates a form that lets users generate a new page with the correct format.
<pre>{{Infobox
 
|Box title = Character Name
 
|Row 1 title = Hair color|Row 1 info = <!--insert hair color here-->
 
|Row 2 title = Eye color|Row 2 info = <!--insert eye color here-->
 
|Row 3 title = Height|Row 3 info = <!--insert height here-->}}
 
 
==Overview==
 
 
==Background==
 
 
==Important Events==
 
 
* ...</pre>
 
 
* Save your template.
 
 
 
==='''Phase Two: Create the Page Creation Tool'''===
 
 
There are two common ways to approach this part.
 
 
====''Method One: Input Boxes''====
 
 
''This method creates a form that lets users generate a new page with the correct format.''
 
   
 
* On the page where you'd like to invite users to create a new article, enter the following code to create the following input box:
 
* On the page where you'd like to invite users to create a new article, enter the following code to create the following input box:
Line 48: Line 27:
 
!To make this:
 
!To make this:
 
|-
 
|-
 
|<pre>
|
 
  +
<inputbox>
<pre>
 
  +
type=create
<createbox>
 
preload=Template:Character
+
preload=Template:Character/preload
 
width=25
 
width=25
</createbox>
+
</inputbox>
 
</pre>
 
</pre>
  +
|<inputbox>
|
 
  +
type=create
<createbox>
 
preload=Template:Character
+
preload=Template:Character/preload
width=25
+
width=25
  +
</inputbox>
</createbox>
 
 
|}
 
|}
   
: '''Bonus tip:''' you can add <tt>editintro=pagename</tt> as an extra line to this code, and replace "pagename" with a page that has a few lines of welcome text. This welcome text will be displayed at the top of your new page instead of the text of MediaWiki:Newarticletext.
+
: '''Tip:''' you can add <code>editintro=pagename</code> as an extra line to this code, and replace "pagename" with a page that has a few lines of welcome text. This welcome text will be displayed at the top of your new page instead of the text of MediaWiki:Newarticletext.
   
 
* Save your page and try out creating a new page called "Bobby" using that text box.
 
* Save your page and try out creating a new page called "Bobby" using that text box.
   
 
==== Method two: intro links ====
 
This method adds a link to the top of the edit screen, allowing a user to generate the correct format after they've started the page creation process.
   
 
* Go to MediaWiki:Newarticletext on your community and open it for editing.
====''Method Two: Intro Links''====
 
 
''This method adds a link to the top of the edit screen, allowing a user to generate the correct format after they've started the page creation process.''
 
 
* Go to MediaWiki:Newarticletext on your wiki and open it for editing.
 
 
 
* Add the following code:
 
* Add the following code:
   
<pre>[{{fullurl:{{FULLPAGENAMEE}}|action=edit&preload=Template:Character}} Character Page]</pre>
+
<pre>[{{fullurl:{{FULLPAGENAME}}
  +
|action=edit&preload=Template:Character/preload}} Character page]</pre>
   
 
* Add some explanation text before this link, explaining that users should only click it if they're creating a character page.
 
* Add some explanation text before this link, explaining that users should only click it if they're creating a character page.
 
 
* Save your work.
 
* Save your work.
 
* Create a new page on your community the normal way, and see your new welcome text with the link!
   
  +
Note that this method only works if the editor's language setting (Set on [[Special:Preferences]]) matches the language of the wiki. Editors using different languages will see the text in MediaWiki:Newarticletext/''<nowiki>[[their language code]]</nowiki>''. Currently, those sub pages are only editable by Fandom staff.
* Create a new page on your wiki the normal way, and see your new welcome text with the link!
 
   
  +
==== Method three: using some ready-made code ====
  +
If you're an admin who's unafraid of a little [[Help:CSS and JS customization|custom JavaScript]], you may want to explore a ready made solution on Dev Wiki. If you're already familiar with grabbing code from Dev Wiki via [[Help:Including additional CSS and JS#ImportJS|ImportJS]], the well-documented [[w:c:dev:PreloadTemplates|PreloadTemplates]] JS might make a good deal of sense for you.
 
== See also ==
  +
* [[w:c:dev:PreloadTemplates|PreloadTemplates]] on DevWiki
  +
* [[Help:Editing]]
  +
* [[Help:New page]]
 
* [[Help:Templates]]
   
  +
== Further help and feedback ==
==See also==
 
*[[Help:CreatePage|CreatePage]]
 
*[[Help:Templates|Templates]]
 
 
==Further Help & Feedback==
 
 
{{Help and feedback section}}
 
{{Help and feedback section}}
  +
 
[[de:Hilfe:Vorgegebener Inhalt]]
 
[[de:Hilfe:Vorgegebener Inhalt]]
  +
[[es:Ayuda:Plantillas precargadas]]
[[Category:Help|{{PAGENAME}}]]
 
  +
[[fr:Aide:Modèles préchargés]]
  +
[[ja:ヘルプ:プリロードされたテンプレート]]
  +
[[pt:Ajuda:Predefinições pré-carregadas]]
  +
[[ru:Справка:Презагруженные шаблоны]]
  +
[[tr:Yardım:Önceden yüklenmiş şablonlar]]
  +
[[zh:Help:预载模板]]
  +
 
[[Category:Help]]

Revision as of 09:22, 14 May 2021

Preloaded templates can pre-populate a new page with instructions, page structure, or content. This may be easier for new users to understand than an empty edit box, and can help them create pages that meet the community's style guidelines.

The following page describes an advanced method for managing page creation, and one that mostly applies to the source editor. For the basics of page creation, please see this page.

Step by step

Let's assume you want to create a new article page called "Bobby". You want that page to include an infobox and a few section headers, because you've decided that all of your character pages should begin this way. You also want to set things up so that other editors can start new character pages the same way, too.

Here's how you can do that with preloaded templates.

Preload

Preloaded templates in action

Create the template

  • Create a new page on your community in the Template or Project namespace. In our example, you can call this page Template:Character/preload. It should be classified as "Design" if it is in Template:. The advantage to placing it in Project (also known as the wiki's name in the namespace, such as Game of Thrones Wiki:Character Page) is that it will not be a suggestion in the various editors.
  • Edit this template to include the content and template calls you want to appear when you create a new page.
  • Save your preload template.

Create the page creation tool

There are three common ways to approach this part:

Method one: input boxes

This method creates a form that lets users generate a new page with the correct format.

  • On the page where you'd like to invite users to create a new article, enter the following code to create the following input box:
Type this: To make this:
 <inputbox>
  type=create
  preload=Template:Character/preload
  width=25
 </inputbox>

Tip: you can add editintro=pagename as an extra line to this code, and replace "pagename" with a page that has a few lines of welcome text. This welcome text will be displayed at the top of your new page instead of the text of MediaWiki:Newarticletext.
  • Save your page and try out creating a new page called "Bobby" using that text box.

Method two: intro links

This method adds a link to the top of the edit screen, allowing a user to generate the correct format after they've started the page creation process.

  • Go to MediaWiki:Newarticletext on your community and open it for editing.
  • Add the following code:
[{{fullurl:{{FULLPAGENAME}}
|action=edit&preload=Template:Character/preload}} Character page]
  • Add some explanation text before this link, explaining that users should only click it if they're creating a character page.
  • Save your work.
  • Create a new page on your community the normal way, and see your new welcome text with the link!

Note that this method only works if the editor's language setting (Set on Special:Preferences) matches the language of the wiki. Editors using different languages will see the text in MediaWiki:Newarticletext/[[their language code]]. Currently, those sub pages are only editable by Fandom staff.

Method three: using some ready-made code

If you're an admin who's unafraid of a little custom JavaScript, you may want to explore a ready made solution on Dev Wiki. If you're already familiar with grabbing code from Dev Wiki via ImportJS, the well-documented PreloadTemplates JS might make a good deal of sense for you.

See also

Further help and feedback