Go Back   NuHIT - SEO, Wiki, Forums > Documentation > NuWiki Documentation
 
 
Article Tools
  #1  

NuWiki Templates

« Previous Chapter   NuWiki Manual
  Next Chapter »

 

NuWiki Manual - Contents

A NuWiki Template is a NuWiki Article that can be inserted in other articles. You can use templates to define common content that will be included in multiple articles (for instance a disclaimer, or instructions, or guidelines), and then when you want to include that content in an article, you simply reference the template.

You can insert a template into a NuWiki Article by using the special BBCode TEMPLATE. The syntax for the Template BBCode is:

PHP Code:
[template]Template Name[/template
NuWiki Templates support named and numbered parameters. The syntax is as follows:

PHP Code:
[template]Template Name|arg1|arg2|arg3|arg4[/template
Where arg1, arg2, etc, are the values for the corresponding parameters.

To use named parameters use the following syntax:
PHP Code:
[template]Template Name|name1=value1|name2=value2[/template
In the body of a Template, you can use the arguments passed in by using this syntax:

PHP Code:
{{{argname|default}}} 
Where:
  • argname is the name of the argument (or the argument number if using numbered parameters);
  • default is optional, and specifies the value if the template were to be instantiated without the corresponding parameter.

For instance, let's say you create a template named TIP, and the content of this template is:

PHP Code:
[div=background-color:Cornsilk;width:600px;padding:5px]{{{1}}}[/div
The key here is the {{{1}}}, which refers to the first parameter passed when calling the template.

Then when you want to use the template, the following can be used:

PHP Code:
[template]TIP|some text here[/template
In this example we used 'numbered arguments', these are arguments for which a name was not specified. If you have many arguments, you can assign names to them as explained earlier in this article.

For more information about other NuWiki BBCodes, go to the NuWiki Syntax article.

« Previous Chapter   NuWiki Manual
  Next Chapter »

Contributors: ElfMage
Created by ElfMage, 04-26-2007 at 01:09 PM
Last edited by ElfMage, 09-06-2007 at 11:39 AM
2 Comments , 1854 Views
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Tools

Posting Rules
You may not create new articles
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vBWiki Pro & vB templates pegasus vbWiki Pro - Pre-sales and feedback 23 12-16-2006 02:40 PM


All times are GMT -4. The time now is 02:46 PM.