Actions

JDOC

Difference between revisions of "Creating pages with preloaded text"

From Joomla! Documentation

m
m
Line 2: Line 2:
 
''Please note: Some techniques recommended in this article require the use of extensions.  Please use with care.  The status assigned to each extension is self-assigned by the maintainer and does not represent the opinion of the MediaWiki development team.''
 
''Please note: Some techniques recommended in this article require the use of extensions.  Please use with care.  The status assigned to each extension is self-assigned by the maintainer and does not represent the opinion of the MediaWiki development team.''
 
----
 
----
This article is based on [[Mediawiki:Manual:Creating_pages_with_preloaded_text]]
+
{{underconstruction|notready=1
 +
|=This article is based on http://www.mediawiki.org/wiki/Manual:Creating_pages_with_preloaded_text
 +
|placedby=--<span class="plainlinks">[[User:CirTap|CirTap]] <small>([[User talk:CirTap|talk]] • [[Special:Contributions/CirTap|contribs]])</small></span> 20:23, 9 May 2008 (EDT)
 +
|category=[[Category:Project pages undergoing construction]]}}
 
</div>
 
</div>
 
'''Preloading wikitext''' is one of many techniques for helping users create pages more quickly and for improving the quality of those pages.  Instead of creating a new page from scratch, users are presented with a partially created page, and possibly instructions for filling it in.
 
'''Preloading wikitext''' is one of many techniques for helping users create pages more quickly and for improving the quality of those pages.  Instead of creating a new page from scratch, users are presented with a partially created page, and possibly instructions for filling it in.
Line 60: Line 63:
  
 
Thus there is neither a complete inclusion nor a regular transclusion. See also [http://bugzilla.wikimedia.org/show_bug.cgi?id=5210 bug 5210] (since 2006-03-09).
 
Thus there is neither a complete inclusion nor a regular transclusion. See also [http://bugzilla.wikimedia.org/show_bug.cgi?id=5210 bug 5210] (since 2006-03-09).
 +
 +
<!--
  
 
== Extensions ==
 
== Extensions ==
Line 71: Line 76:
  
 
* [[Mediawiki:Extension:Add Article to Category]] - puts an add-an-article button on each category.  When an article is created using this extension it will automatically contain the wiki text for including the article in that category, i.e. <nowiki>[[Category:...]]</nowiki>
 
* [[Mediawiki:Extension:Add Article to Category]] - puts an add-an-article button on each category.  When an article is created using this extension it will automatically contain the wiki text for including the article in that category, i.e. <nowiki>[[Category:...]]</nowiki>
 +
-->
 +
 +
{{GFDL}}
  
 +
<noinclude>
 
[[Category:Template documentation|preload]]
 
[[Category:Template documentation|preload]]
 
[[Category:Wiki Templates|preload]]
 
[[Category:Wiki Templates|preload]]
 +
</noinclude>

Revision as of 19:23, 9 May 2008

Please note: Some techniques recommended in this article require the use of extensions. Please use with care. The status assigned to each extension is self-assigned by the maintainer and does not represent the opinion of the MediaWiki development team.


Documentation all together tranparent small.png
Under Construction

This project page or section is in the process of an expansion or major restructuring, and is not yet ready for use. You are welcome to assist in its construction by editing it as well. This template was placed by --CirTap (talkcontribs) 20:23, 9 May 2008 (EDT). If this project page or section has not been edited in several days, please remove this template.
This page was last edited by CirTap (talk| contribs) 6 years ago. (Purge)

[[Category:|Creating pages with preloaded text]]

Preloading wikitext is one of many techniques for helping users create pages more quickly and for improving the quality of those pages. Instead of creating a new page from scratch, users are presented with a partially created page, and possibly instructions for filling it in.

This technique is especially useful when:

  • wiki users are willing to read and write simple wikitext (sometimes an issue on intranet installations of MediaWiki)
  • the wiki contains one or more categories of articles with lots of pro-forma text
  • the information that needs to be collected for such articles is a mix of structured data and free form text

Contents


Creating pages with preloaded text is a three step process:

  1. Design the preload file and its supporting templates
  2. Create pages for the preload files and supporting templates
  3. Set up the trigger to load the preload file

Designing the preload file

The preload file is often an article with an embedded template. For example, if you wanted one article for each customer or marketing contact, you might want to preload text that looks something like this:

   <!-- Please enter your customer's contact information after the equal sign.
        If you need help uploading the business card images, please see
        [[Help:Uploading business card images]] 
   -->
   {{CustomerContact
   |Number=
   |BizcardImage=
   |Primary phone number=
   |Address=
   }}

Naming and documenting the preload file

Some extensions (see mediawiki:Extension:Boilerplate) have specific expectations as to where the preloaded text should be stored. Others leave that decision entirely up to the system administrator.

Naming and documenting the preload file takes some care because preload files don't always show up on "What links here" and so are at risk for accidental deletion (no info/no links - hard to tell from an article that got created and abandoned). For template based preload files, the following naming conventions may help avoid accidental deletion:

  • place template in Template:CategoryName
  • place preload file in Template:CategoryName/Preload

While documentation of regular templates is often presented on the template page itself (using noinclude tags), this is not possible for a page to be preloaded. Also categories and interlanguage links for the preload page itself are not possible without affecting the wikitext that is preloaded. The talk page has to be used for all these.

Loading the preload file

Preloading can be done with a preload parameter in a URL like http://docs.joomla.org/index.php?title=Joomla:Sandbox/Preloadtest&action=edit&preload=Template:Preload_demo which links to the edit box of a new page, preloaded with Template:Preload demo (talk, backlinks, edit). There are also a number of extensions available to trigger your preload file, see below.

The wikitext of the source page, including noinclude parts and tags, but not includeonly tags, is preloaded into the editbox if the page or section does not exist yet. If the page or section to be edited already exists then only its wikitext is loaded, the preload command is ignored.

Notes:

  • Both the <noinclude> and </noinclude> tags AND their content are preloaded, which means you can't categorize the source page or include some self-documentation: it'd be dumped into the preloaded text too.
  • The <includeonly> and </includeonly> tags are stripped from the source page. If you need the preloaded text to provide includeonly tags, you can use
<include<includeonly></includeonly>only>
in your source: since the two middle tags will be stripped, the preloaded text will end up with just the <includeonly> wanted.

Thus there is neither a complete inclusion nor a regular transclusion. See also bug 5210 (since 2006-03-09).


GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.