Difference between revisions of "Template:Tnavbox basic"
From Conservapedia
m (debugging) |
|||
(12 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
AUTHOR OR SYSOP FAMILIAR WITH TEMPLATES | AUTHOR OR SYSOP FAMILIAR WITH TEMPLATES | ||
--> | --> | ||
− | <includeonly> | + | <includeonly><table class="navbox" style="float: center; text-align: center; font-size: 80%; clear:right; background:white; border: 2px solid green;" cellspacing="0" cellpadding="2"> |
− | <table class=" | + | |
{| class="navbox" cellpadding="1" cellspacing="0" width={{{width|100}}}% style="float: center; margin: 0 0 0 0; text-align:center; border: 1px solid #995;" | {| class="navbox" cellpadding="1" cellspacing="0" width={{{width|100}}}% style="float: center; margin: 0 0 0 0; text-align:center; border: 1px solid #995;" | ||
− | |height="20" style="font-size: 95%; background-color:{{{titleback-color}}}; text-align:center; margin-bottom:2px;" |'''[[{{{ | + | |height="20" style="font-size: 95%; background-color:{{{titleback-color}}}; text-align:center; margin-bottom:2px;" |'''[[{{{titlelink}}}<span style="color:{{{titletext-color}}}">{{{titletext}}}</span> ]]''' |
|--- | |--- | ||
|style="font-size: 85%; color:{{{bodytext-color}}} ;background-color:{{{bodyback-color}}};"|{{{body}}} | |style="font-size: 85%; color:{{{bodytext-color}}} ;background-color:{{{bodyback-color}}};"|{{{body}}} | ||
|- | |- | ||
− | |} | + | |}</includeonly><noinclude> |
− | </includeonly> | + | |
− | + | ||
<!-----------------------Documentation---------------------> | <!-----------------------Documentation---------------------> | ||
− | + | [[Category: Template|{{PAGENAME}}]] | |
− | [[Category: Template]] | + | {{TemplateDoc |
− | {{TemplateDoc|pages=Navigation box templates|purpose= | + | |pages=Navigation box templates |
+ | |purpose=Create template for new horizontal nav boxes | ||
+ | |cat=Template | ||
+ | }} | ||
{{Parms| | {{Parms| | ||
{{Parm|width |Width of box in per cent |no |Default 100}} | {{Parm|width |Width of box in per cent |no |Default 100}} | ||
Line 26: | Line 26: | ||
}} | }} | ||
− | This template is a constructor for ''''' | + | This template is a constructor for '''''horizontal navbox templates'''''. The new template takes three parameters: |
− | + | <nowiki>{{{titlelink}}}</nowiki> | |
− | + | <nowiki>{{{titletext}}}</nowiki> | |
− | + | <nowiki>{{{body}}}</nowiki> | |
<!----------------Format for sub-template -----------------> | <!----------------Format for sub-template -----------------> | ||
Line 37: | Line 37: | ||
Copy and paste the following to new navbox template. | Copy and paste the following to new navbox template. | ||
+ | <!--This need to be expanded so that new template includes sample text for navbox. | ||
+ | I'm working on it! | ||
+ | --> | ||
<pre> | <pre> | ||
+ | <nowiki><</nowiki>includeonly<nowiki>></nowiki> | ||
+ | <nowiki>{{</nowiki>Tnavbox_basic | ||
+ | |titleback-color= | ||
+ | |titletext-color= | ||
+ | |bodyback-color= | ||
+ | |bodytext-color= | ||
+ | |titlelink=<nowiki>{{#if:{{{titlelink|}}} | <!-- then: include link and pipe-->{{{titlelink}}}{{!}} | <!-- else: nothing -->}}</nowiki> | ||
+ | |titletext=<nowiki>{{{titletext}}}</nowiki> | ||
+ | |body=<nowiki>{{{body}}}</nowiki> | ||
+ | <nowiki>}}</nowiki> | ||
+ | <nowiki><</nowiki>/includeonly<nowiki>></nowiki> | ||
− | + | <nowiki><</nowiki>noinclude> | |
− | + | <nowiki>[[</nowiki>Category:Template]] | |
− | + | <nowiki><</nowiki>/noinclude> | |
− | + | </pre> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | Note: This creates a template to use for a family of horizontal navboxes, it does not create the navboxes themselves! Name new templates in the style '''Tnb_NEW_TEMPLATE'''. Do not forget to document any new template and navboxes you create. | |
− | + | ||
− | + | Documentation for new templates will take the form: | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | <pre> | |
− | + | <nowiki>{{ {{</nowiki>PAGENAME}} | |
− | + | |titlelink=LINK FOR NAVIGATION BOX TITLE (OPTIONAL) | |
− | + | |titletext=TEXT TO DISPLAY IN NAVIGATION BOX TITLE | |
− | + | |body=<nowiki>{{nowrap|[[LINK 1|TEXT 1]] •}} {{nowrap|[[LINK 2|TEXT 2]] •}} (...more items...) {{nowrap|[[ LINK N|TEXT N]]}}</nowiki> | |
− | + | <nowiki>}}</nowiki> | |
− | + | <nowiki><</nowiki>includeonly<nowiki>></nowiki> | |
− | + | <nowiki>[[</nowiki>Category:<!--''Category name''-->]] | |
− | + | <nowiki><</nowiki>/includeonly<nowiki>></nowiki> | |
− | + | <nowiki><</nowiki>noinclude> | |
− | + | <nowiki>[[</nowiki>Category:Navigation box]] | |
− | + | <nowiki><</nowiki>/noinclude> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</pre> | </pre> | ||
+ | Note that all '''body''' entries must be on one line. | ||
</noinclude> | </noinclude> |
Latest revision as of 14:06, December 1, 2008
Template: Tnavbox basic | |
---|---|
Use on | Navigation box templates |
Use for | Create template for new horizontal nav boxes |
Category template applies to page | Template |
Template Parameters (See using templates). | |||
---|---|---|---|
Name | Purpose | Required? | Comment |
width | Width of box in per cent | no | Default 100 |
titleback-color | Title bar background color | no | defined color name or hex value (#xxyyzz) |
titletext-color | Title bar text color | no | idem |
bodyback-color | Body background color | no | idem |
bodytext-color | Body text color | no | idem |
This template is a constructor for horizontal navbox templates. The new template takes three parameters:
{{{titlelink}}} {{{titletext}}} {{{body}}}
Sample text block
Copy and paste the following to new navbox template.
<includeonly> {{Tnavbox_basic |titleback-color= |titletext-color= |bodyback-color= |bodytext-color= |titlelink={{#if:{{{titlelink|}}} | <!-- then: include link and pipe-->{{{titlelink}}}{{!}} | <!-- else: nothing -->}} |titletext={{{titletext}}} |body={{{body}}} }} </includeonly> <noinclude> [[Category:Template]] </noinclude>
Note: This creates a template to use for a family of horizontal navboxes, it does not create the navboxes themselves! Name new templates in the style Tnb_NEW_TEMPLATE. Do not forget to document any new template and navboxes you create.
Documentation for new templates will take the form:
{{ {{PAGENAME}} |titlelink=LINK FOR NAVIGATION BOX TITLE (OPTIONAL) |titletext=TEXT TO DISPLAY IN NAVIGATION BOX TITLE |body={{nowrap|[[LINK 1|TEXT 1]] •}} {{nowrap|[[LINK 2|TEXT 2]] •}} (...more items...) {{nowrap|[[ LINK N|TEXT N]]}} }} <includeonly> [[Category:<!--''Category name''-->]] </includeonly> <noinclude> [[Category:Navigation box]] </noinclude>
Note that all body entries must be on one line.