From Fedora Project Wiki

Revision as of 03:50, 29 June 2010 by Dafrito (talk | contribs) (Added a template to decouple piped link text with type of link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

[[{{{page}}}|{{{1}}}]]

Template documentation [edit]

This documentation is transcluded from Template:Link/doc. It will not be transcluded on pages that use this template.

Template:Link allows the text used for a link to be independent of the linked site. This is useful for template authors who wish to allow both external and internal links while still providing the displayed text used in the template.

The flexibility provided by this template is usually not necessary, so avoid using it if the customization is not needed. Prefer direct links which are much cleaner, such as [{{{1}}} A link to the first parameter] or [[{{{1}}}|the first parameter]].

To use this template as a template author, you should pass it both a url parameter and a page parameters: {{link|Agenda|url={{{agenda_url}}|page={{{agenda_page}}}}}. Template users should only provide one or the other - specifically agenda_url=http://lists.fedoraproject.org/pipermail/test/2010-June/091736.html or agenda_page=Marketing_meetings#Agenda.

Examples

Contrived example

This example demonstrates very basic uses of this template.

Non-functional example: {{Link|My page}}<br/>
Page provided: {{Link|My page|page=User:Dafrito}}<br/>
URL provided: {{Link|My page|url=http://fedoraproject.org}}

Output:

Non-functional example: <onlyinclude>[[{{{page}}}|My page]]<onlyinclude>

Template loop detected: Template:Tempdoc
Page provided: <onlyinclude>My page<onlyinclude>

Template loop detected: Template:Tempdoc
URL provided: <onlyinclude>My page<onlyinclude>

Template loop detected: Template:Tempdoc

Typical example

This example demonstrates typical uses of this template.

Non-functional example: {{Link|My page|page={{{user_page}}}|url={{{user_url}}}}}<br/>
Page provided: {{Link|My page|page=User:dafrito|url={{{user_url|}}}}}<br/>
URL provided: {{Link|My page|page={{{user_page|}}}|url=http://fedoraproject.org}}

Output:

Non-functional example: <onlyinclude>[{{{user_url}}} My page]<onlyinclude>

Template loop detected: Template:Tempdoc
Page provided: <onlyinclude>My page<onlyinclude>

Template loop detected: Template:Tempdoc
URL provided: <onlyinclude>My page<onlyinclude>

Template loop detected: Template:Tempdoc