Template:Ifarchive index link: Difference between revisions

From IFWiki

m (JTN moved page Template:Ifarchive index to Template:Ifarchive index link: This is a bare link template, so use the naming convention for those)
(use positional parameter instead of fragment=, for brevity)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>https://ifarchive.org/indexes/if-archive/{{{1}}}</includeonly><noinclude>Link to a directory index at the [[IF Archive]].
<includeonly>https://ifarchive.org/indexes/if-archive/{{{1}}}{{#if:{{{2|}}}|&#35;{{{2}}}|}}</includeonly><noinclude>Bare link to a directory index at the [[IF Archive]]. (See also [[:Template:ifarchive index]] for a link with description, [[:Template:ifarchive link]] for a bare link directly to a file, and [[:Template:ifarchive unbox link]] for a bare link to view a compressed file's contents.)


This:
This:
  <nowiki>[{{ifarchive index|games/mini-comps/imaginary/}} imaginary games]</nowiki>
  <nowiki>[{{ifarchive index link|games/mini-comps/imaginary/}} imaginary games]</nowiki>
produces:
produces:
[{{ifarchive index|games/mini-comps/imaginary/}} imaginary games]
[{{ifarchive index link|games/mini-comps/imaginary/}} imaginary games]
 
The optional second parameter allows linking directly to the index entry for a specific file within a directory listing.
 
<nowiki>[{{ifarchive index link|games/tads/|Get-Corn.t3}} GET CORN]</nowiki>
produces:
[{{ifarchive index link|games/tads/|Get-Corn.t3}} GET CORN]
 
Special case: the fragment ID in the second parameter is almost always simply the filename, but unusual characters in filenames, such as spaces and certain punctuation, can lead to differences. The escaping system used in this case uses equals signs <tt>=</tt>, which you'll need to write as <tt>[[:Template:=|<nowiki>{{=}}</nowiki>]]</tt> to avoid ambiguity with template syntax.
 
<nowiki>[{{ifarchive index link|games/glulx/|{{=}}27{{=}}Steading{{=}}20{{=}}of{{=}}20{{=}}the{{=}}20{{=}}Hill{{=}}20{{=}}Giant{{=}}20{{=}}Chief.gblorb}} 'Steading of the Hill Giant Chief.gblorb]</nowiki>
produces:
[{{ifarchive index link|games/glulx/|{{=}}27{{=}}Steading{{=}}20{{=}}of{{=}}20{{=}}the{{=}}20{{=}}Hill{{=}}20{{=}}Giant{{=}}20{{=}}Chief.gblorb}} 'Steading of the Hill Giant Chief.gblorb]
 
[[Category:Link templates]]</noinclude>
[[Category:Link templates]]</noinclude>

Latest revision as of 00:21, 19 August 2024

Bare link to a directory index at the IF Archive. (See also Template:ifarchive index for a link with description, Template:ifarchive link for a bare link directly to a file, and Template:ifarchive unbox link for a bare link to view a compressed file's contents.)

This:

[{{ifarchive index link|games/mini-comps/imaginary/}} imaginary games]

produces: imaginary games

The optional second parameter allows linking directly to the index entry for a specific file within a directory listing.

[{{ifarchive index link|games/tads/|Get-Corn.t3}} GET CORN]

produces: GET CORN

Special case: the fragment ID in the second parameter is almost always simply the filename, but unusual characters in filenames, such as spaces and certain punctuation, can lead to differences. The escaping system used in this case uses equals signs =, which you'll need to write as {{=}} to avoid ambiguity with template syntax.

[{{ifarchive index link|games/glulx/|{{=}}27{{=}}Steading{{=}}20{{=}}of{{=}}20{{=}}the{{=}}20{{=}}Hill{{=}}20{{=}}Giant{{=}}20{{=}}Chief.gblorb}} 'Steading of the Hill Giant Chief.gblorb]

produces: 'Steading of the Hill Giant Chief.gblorb