Template:Fgaddon aircraft source: Difference between revisions

Jump to navigation Jump to search
Elimination of the 'file' parameter made redundant by {{fgaddon aircraft url}}. The template now defaults to producing Mediawiki links rather than text URLs, but the 'full' param has been added for the subtemplates.
(Internal FGAddon links.)
(Elimination of the 'file' parameter made redundant by {{fgaddon aircraft url}}. The template now defaults to producing Mediawiki links rather than text URLs, but the 'full' param has been added for the subtemplates.)
Line 18: Line 18:
| line{{#if:{{{line|{{{l|}}}}}}||NULL}}            = {{{line|{{{l}}}}}}
| line{{#if:{{{line|{{{l|}}}}}}||NULL}}            = {{{line|{{{l}}}}}}
| view{{#if:{{{view|{{{v|}}}}}}||NULL}}            = {{{view|{{{v}}}}}}
| view{{#if:{{{view|{{{v|}}}}}}||NULL}}            = {{{view|{{{v}}}}}}
| text{{#if:{{{text|{{{t|{{{file|}}}}}}}}}||NULL}} = {{{text|{{{t|{{#if: {{{file|}}} | {{{1}}}/{{{2}}} }} }}}}}}
| text{{#if:{{{text|{{{t}}}}}}||NULL}}             = {{{text|
                                                        {{{t|
                                                          {{#ifeq: {{{full|}}} | 1
                                                            |
                                                            | {{#if: {{{1|}}}
                                                                |{{strip whitespace|{{{1}}}}}<!--
                                                            -->{{#if: {{{2|}}} |/{{strip whitespace|{{{2}}}}}}}
                                                                | FGAddon aircraft
                                                              }}
                                                          }}
                                                        }}}
                                                      }}}
| pre{{#if:{{{pre|}}}||NULL}}                      = {{{pre}}}
| pre{{#if:{{{pre|}}}||NULL}}                      = {{{pre}}}
| post{{#if:{{{post|}}}||NULL}}                    = {{{post}}}
| post{{#if:{{{post|}}}||NULL}}                    = {{{post}}}
| simplepath{{#if:{{{simplepath|}}}||NULL}}        = {{{simplepath}}}
| simplepath{{#if:{{{simplepath|}}}||NULL}}        = {{{simplepath}}}
| full                                             = {{#if: {{{file|}}}
| full{{#if:{{{full|}}}||NULL}}                     = {{{full}}}
                                                        | 0
                                                        | {{#if: {{{text|{{{t|}}}}}}
                                                            | 0
                                                            | {{#if: {{{pre|}}}
                                                                | 0
                                                                | 1
                                                              }}
                                                          }}
                                                      }}
}}<noinclude>
}}<noinclude>


Line 37: Line 39:
__NOTOC__
__NOTOC__
== Goal ==
== Goal ==
This template is for creating links or URLs for files in the [[FGAddon]] svn version control repository.  It is a subtemplate of the master {{tl|repo link}} template designed to simplify the interface by being specific for the [[FGAddon]] repository and avoiding the need to supply the <code>Aircraft/</code> directory.
This template is for creating Mediawiki links or URLs for files in the [[FGAddon]] svn version control repository.  It is a subtemplate of the master {{tl|repo link}} template designed to simplify the interface by being specific for the [[FGAddon]] repository and avoiding the need to supply the <code>Aircraft/</code> directory.


{{repo link/doc usage
{{repo link/doc usage
Line 43: Line 45:
| param1    = 1 | name1 = aircraft | type1 = num  | pos1 = 1 | desc1 = The aircraft directory name.  The path is constructed as <code><nowiki><branch>/Aircraft/<aircraft></nowiki></code>.  If empty, the path of <code><branch>/Aircraft/</code> will be used.
| param1    = 1 | name1 = aircraft | type1 = num  | pos1 = 1 | desc1 = The aircraft directory name.  The path is constructed as <code><nowiki><branch>/Aircraft/<aircraft></nowiki></code>.  If empty, the path of <code><branch>/Aircraft/</code> will be used.
| param2    = 1 | name2 = path    | type2 = num  | pos2 = 2 | desc2 = The file path following from the aircraft directory name.  The full file path will be constructed as <code><nowiki><branch>/Aircraft/<aircraft>/<path></nowiki></code>.
| param2    = 1 | name2 = path    | type2 = num  | pos2 = 2 | desc2 = The file path following from the aircraft directory name.  The full file path will be constructed as <code><nowiki><branch>/Aircraft/<aircraft>/<path></nowiki></code>.
| param3    = 1 | name3 = file    | type3 = named            | desc3 = If set, then a link to the file rather than the full URL will be shown.
| cmd        = 1 | eg_cmd      = svn co
| cmd        = 1 | eg_cmd      = svn co
| opt        = 1
| opt        = 1
Line 89: Line 90:
{{fgaddon aircraft source|F-15|f15c-set.xml|l=8}}
{{fgaddon aircraft source|F-15|f15c-set.xml|l=8}}


=== Usage in a wiki URL ===
=== Custom text ===
  <nowiki>[</nowiki>{{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{cbr}} The F-15's missile system<nowiki>]</nowiki>
  {{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}}text=The F-15's missile system{{cbr}}
[{{fgaddon aircraft source|F-15|Nasal/fox2.nas}} The F-15's missile system]
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|text=The F-15's missile system}}


=== Pointer to a file ===
=== URL ===
  {{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}}file=yes{{cbr}}
  {{obr}}fgaddon aircraft source{{!}}F-15{{!}}Nasal/fox2.nas{{!}}full=1{{cbr}}
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|file=yes}}
{{fgaddon aircraft source|F-15|Nasal/fox2.nas|full=1}}


=== The repository ===
=== The repository ===

Navigation menu