Difference between revisions of "Template:Citelink"

From PC-BSD Wiki
Jump to: navigation, search
(Implementation - 2nd part)
(Explanation)
(46 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[{{#switch: {{{1}}}
+
<onlyinclude><span class="plainlinks">[{{template:ourInterwiki|first={{{1|}}}}}{{{url|{{{2|{{{1|}}}}}}}}} {{{txt|{{{3|{{{2|{{{1|}}}}}}}}}}}}]</span>{{#tag:ref|{{ourInterwiki|first={{{1}}}}}{{{url|{{{2|}}}}}}|name="{{ourInterwiki|first={{{1}}}}}{{{url|{{{2|{{{1}}}}}}}}}"}}</onlyinclude><noinclude> <!-- above works as is. do not adjust -->
| fbsd      = http://wiki.freebsd.org/        <!-- transclusion currently breaks the function here -->
+
== Explanation ==  
| mw        = http://www.mediawiki.org/wiki/
+
| trac      = http://trac.pcbsd.org/wiki/
+
| wikipedia = http://en.wikipedia.org/wiki/
+
|                             
+
}}{{{url|{{{2|{{{1}}}}}}}}} {{{txt|{{{3|{{{2|{{{1|}}}}}}}}}}}}]{{#tag:ref|{{#switch: {{{1}}}
+
| fbsd      = http://wiki.freebsd.org/
+
| mw        = http://www.mediawiki.org/wiki/
+
| trac      = http://trac.pcbsd.org/wiki/
+
| wikipedia = http://en.wikipedia.org/wiki/
+
|                             
+
}}{{{url|{{{2|error}}}}}}|name="{{#switch: {{{1}}}
+
| fbsd      = http://wiki.freebsd.org/
+
| mw        = http://www.mediawiki.org/wiki/
+
| trac      = http://trac.pcbsd.org/wiki/
+
| wikipedia = http://en.wikipedia.org/wiki/
+
|                             
+
}}{{{url|{{{2|{{{1}}}}}}}}}"}}<noinclude> <!-- I believe it may be the addition of the references tag to alleviate the error, which causes a parse/formatting error in the template, even though it is contained within the noinclude portions -->
+
== Explanation ==
+
  
This template exists to simplify addition of a footnote feature within the handbook pages, to reduce the work needed when the handbook wiki is published into the ''dead tree'' version. It may also facilitate verification of all external links except that this assumes that all external links (of both types below) are in the wiki using this template.
+
This template exists to simplify addition of a footnote feature within the handbook pages, to reduce the work needed when the handbook wiki is published into the ''dead tree'' version. It may also facilitate verification of all external links except that this assumes that all external links (of both types below) are in the wiki using this template. In addition, the links are made 'simple' which means there will only be the subscripted numeral within square brackets, and no square with upper-right pointing arrow symbol.
  
 
== Implementation - 1st part ==
 
== Implementation - 1st part ==
 +
 
The ''Citelink'' template method to satisfy the per-link part.
 
The ''Citelink'' template method to satisfy the per-link part.
  
 
=== External ===
 
=== External ===
 +
 
: The URL is for a location outside of wiki.pcbsd.org.  
 
: The URL is for a location outside of wiki.pcbsd.org.  
 
:: For the link use '''<nowiki>{{Citelink|url=</nowiki>'''''complete URL'''''|txt='''''alternate text'''''}}'''
 
:: For the link use '''<nowiki>{{Citelink|url=</nowiki>'''''complete URL'''''|txt='''''alternate text'''''}}'''
  
 
=== Special External ===
 
=== Special External ===
: The URL is for a site not part of the PC-BSD wiki, but has a defined shortcut such as for wikipedia.
+
 
 +
: The URL is for a site not part of the PC-BSD wiki, but has a defined ''shortcut'' such as for wikipedia.
 
: '''<nowiki>{{Citelink|</nowiki>'''''shortcut'''''|url='''''page URL'''''|txt='''''alternate text'''''}}'''
 
: '''<nowiki>{{Citelink|</nowiki>'''''shortcut'''''|url='''''page URL'''''|txt='''''alternate text'''''}}'''
 +
::'''Example:''' <nowiki>[http://en.wikipedia.org/wiki/faq/ faq on wikipedia]</nowiki> '''becomes''' <nowiki>{{citelink|wikipedia|url=faq|faq on wikipedia}}</nowiki>
  
 
==== Current defined shortcuts ====
 
==== Current defined shortcuts ====
:fbsd     = http://wiki.freebsd.org/<br>
+
<code>
:mw       = http://www.mediawiki.org/wiki/<br>
+
:      {{padright:commons -|15|-}} {{http}}commons.wikimedia.org/wiki/
:trac      = http://trac.pcbsd.org/wiki/<br>
+
:          {{padright:fbsd -|15|-}} {{http}}wiki.freebsd.org/
:wikipedia = http://en.wikipedia.org/wiki/<br> <!-- I wanted to transclude a list, but it breaks Citelink function now -->
+
:       {{padright:fbsddh -|15|-}} {{http}}www.freebsd.org/doc/en/books/developers-handbook/
 +
:        {{padright:fbsdh -|15|-}} {{http}}www.freebsd.org/doc/en/books/handbook/
 +
:        {{padright:fbsdph -|15|-}} {{http}}/www.freebsd.org/doc/en/books/porters-handbook/
 +
:           {{padright:mw -|15|-}} {{http}}www.mediawiki.org/wiki/
 +
: {{padright:mediawikiwiki -|15|-}} {{http}}www.mediawiki.org/wiki/
 +
:   {{padright:mediazilla -|15|-}} {{http}}bugzilla.wikimedia.org/
 +
:         {{padright:meta -|15|-}} {{http}}meta.wikimedia.org/wiki/
 +
:          {{padright:trac -|15|-}} {{http}}trac.pcbsd.org/wiki/
 +
:     {{padright:wikibooks -|15|-}} {{http}}en.wikibooks.org/wiki/
 +
:     {{padright:wikimedia -|15|-}} {{http}}wikimediafoundation.org/wiki/
 +
:      {{padright:wikinews -|15|-}} {{http}}en.wikinews.org/wiki/
 +
:    {{padright:wikiquote -|15|-}} {{http}}en.wikiquote.org/wiki/
 +
:    {{padright:wikisource -|15|-}} {{http}}wikisource.org/wiki/
 +
:  {{padright:wikispecies -|15|-}} {{http}}species.wikimedia.org/wiki/
 +
:    {{padright:wiktionary -|15|-}} {{http}}en.wiktionary.org/wiki/
 +
:            {{padright:wp -|15|-}} {{http}}en.wikipedia.org/wiki/
 +
:    {{padright:wikipedia -|15|-}} {{http}}en.wikipedia.org/wiki/
 +
:  {{padright:wikiversity -|15|-}} {{http}}en.wikiversity.org/wiki/ <!-- OurInterwiki template cannot transclude here. -->
 +
</code>
  
 
== Implementation - 2nd part ==
 
== Implementation - 2nd part ==
 +
 
The ''refheading'' template method to satisfy the per-page part.
 
The ''refheading'' template method to satisfy the per-page part.
 
: Place one '''<<nowiki>noinclude>{{refheading}}</noinclude</nowiki>>''' at the bottom of the page, above the category links section.
 
: Place one '''<<nowiki>noinclude>{{refheading}}</noinclude</nowiki>>''' at the bottom of the page, above the category links section.
 
:* A large red text warning message which mentions <nowiki><ref></nowiki> is automatically generated by the wiki when the second half of the setup is missing.
 
:* A large red text warning message which mentions <nowiki><ref></nowiki> is automatically generated by the wiki when the second half of the setup is missing.
 +
 
[[Category:templates]]</noinclude>
 
[[Category:templates]]</noinclude>

Revision as of 15:43, 2 September 2012

[ ][1]

Contents

Explanation

This template exists to simplify addition of a footnote feature within the handbook pages, to reduce the work needed when the handbook wiki is published into the dead tree version. It may also facilitate verification of all external links except that this assumes that all external links (of both types below) are in the wiki using this template. In addition, the links are made 'simple' which means there will only be the subscripted numeral within square brackets, and no square with upper-right pointing arrow symbol.

Implementation - 1st part

The Citelink template method to satisfy the per-link part.

External

The URL is for a location outside of wiki.pcbsd.org.
For the link use {{Citelink|url=complete URL|txt=alternate text}}

Special External

The URL is for a site not part of the PC-BSD wiki, but has a defined shortcut such as for wikipedia.
{{Citelink|shortcut|url=page URL|txt=alternate text}}
Example: [http://en.wikipedia.org/wiki/faq/ faq on wikipedia] becomes {{citelink|wikipedia|url=faq|faq on wikipedia}}

Current defined shortcuts

commons ------- http://commons.wikimedia.org/wiki/
fbsd ---------- http://wiki.freebsd.org/
fbsddh -------- http://www.freebsd.org/doc/en/books/developers-handbook/
fbsdh --------- http://www.freebsd.org/doc/en/books/handbook/
fbsdph -------- http:///www.freebsd.org/doc/en/books/porters-handbook/
mw ------------ http://www.mediawiki.org/wiki/
mediawikiwiki - http://www.mediawiki.org/wiki/
mediazilla ---- http://bugzilla.wikimedia.org/
meta ---------- http://meta.wikimedia.org/wiki/
trac ---------- http://trac.pcbsd.org/wiki/
wikibooks ----- http://en.wikibooks.org/wiki/
wikimedia ----- http://wikimediafoundation.org/wiki/
wikinews ------ http://en.wikinews.org/wiki/
wikiquote ----- http://en.wikiquote.org/wiki/
wikisource ---- http://wikisource.org/wiki/
wikispecies --- http://species.wikimedia.org/wiki/
wiktionary ---- http://en.wiktionary.org/wiki/
wp ------------ http://en.wikipedia.org/wiki/
wikipedia ----- http://en.wikipedia.org/wiki/
wikiversity --- http://en.wikiversity.org/wiki/

Implementation - 2nd part

The refheading template method to satisfy the per-page part.

Place one <noinclude>{{refheading}}</noinclude> at the bottom of the page, above the category links section.
  • A large red text warning message which mentions <ref> is automatically generated by the wiki when the second half of the setup is missing.

Cite error: <ref> tags exist, but no <references/> tag was found