User:Gorgon/Sandbox/Sandbox Beta

From Avlis Wiki
Revision as of 01:34, 27 January 2017 by Gorgon (talk | contribs) (New template to test for transcluding sections.)
Jump to navigation Jump to search


Template:Sec (Section Transclusion) Documentation

Credit

As with most general purpose templates people think of creating, someone usually thought of the same idea before, and this template is another example of that (saved me the trouble of making a crappier version of it myself). -- Gorgon --


The original test version of this template was created in Steve Sanbeg's userspace on Wikisource.

  • Steve Sanbeg is also the author of Extension:Labeled Section Transclusion, which will hopefully replace this here one day (see the Description below).
  • While the documentation and format of this template have been changed, the original code should be essentially the same.


Description

This template is for transcluding pre-marked sections of articles.


Usage and Examples

Step 1

Add section tags to the article page that you want to transclude the information from, as shown below:

This is a sample article, with a few sections
<onlyinclude>{{{sec1|This is the first section}}}</onlyinclude>
<onlyinclude>{{{sec2|This is the second section}}}</onlyinclude>
  • This is the article titled Test_Article used in Step 2 below.
  • This template has a limit of 25 numbered sections, so you can only use sec1 through sec25.


Step 2

Add the following code to the target article page that you want to transclude the previously defined section(s) of Test_Article to:


Usage: {{sec|PAGENAME|SECTIONNUMBER}}


  • Replace PAGENAME with the source article page name (Test_Article in the example above). E.g., Test_Article
    • If the source article page is outside of the Main namespace, include the namespace (and full path from it). E.g., User:John/Test_Article
  • Replace SECTIONNUMBER with the matching section number that you want to transclude from the source article (do not include the sec prefix). E.g., 1 - 25


Examples

To transclude the sec1 section from the Test_Article example above, use: {{{sec|Test_Article|1}}

To transclude the sec2 section from the Test_Article example above, use: {{{sec|Test_Article|2}}


Copy of Original Documentation (Steve Sanbeg's Userspace on Wikisource)