Components/Links: Difference between revisions

From Visual Data Wiki
Jump to navigation Jump to search
No edit summary
Tag: 2017 source edit
No edit summary
Tag: 2017 source edit
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Internal Links'''
=== Internal Links ===
 
<syntaxhighlight lang="wikitext">[[Main Page|Send me home]]</syntaxhighlight>
<syntaxhighlight lang="wikitext">[[Main Page|Send me home]]</syntaxhighlight>
[[Main Page|Send me home]]
'''Example:''' [[Main Page|Send me home]]
 
=== External Links ===


'''External Links'''
<syntaxhighlight lang="wikitext">[https://webmo.info WebMo Website]</syntaxhighlight>
<syntaxhighlight lang="wikitext">[https://webmo.info WebMo Website]</syntaxhighlight>
[https://webmo.info WebMo Website]
'''Example:''' [https://webmo.info WebMo Website]
 
=== External Links that behave like internal links ===


'''External Links that behaves like internal links'''
This is useful if you have a link with URL parameters.
This is useful if you have a link with URL parameters.
There are two CSS classes in the <span>-wrapper:
Note CSS class="plainlinks" in the <nowiki><span></nowiki>-wrapper:
# plainlinks - This MediWiki core class hides the symbol for external links
 
# link-target-self - This class comes with [https://www.mediawiki.org/wiki/Extension:LinkTarget Extension:LinkTarget] and overwrites the standard behavior for external links (opens in the same tab instead of a new one).
This class comes with MediWiki core and hides the symbol for external links.
 
In addition this class is configured in LocalSeetings.php for [https://www.mediawiki.org/wiki/Extension:LinkTarget Extension:LinkTarget] and overwrites the standard behavior for external links (opens in the same browser tab instead of a new one).
 
Note: For external links you need to use an underscore (_) for pagenames with spaces (Main_Page instead of Main Page).
 
<syntaxhighlight lang="wikitext"><span class="plainlinks">[{{SERVER}}/wiki/Main_Page?name={{CURRENTUSER}} Send me home with my name as URL parameter]</span></syntaxhighlight>
'''Example:''' <span class="plainlinks">[{{SERVER}}/wiki/Main_Page?name={{CURRENTUSER}} Send me home with my name as URL parameter]</span>
 
Note: At target page URL parameters can be used as follows:
 
<syntaxhighlight lang="wikitext">{{#urlget:parameter-name|default-value}}</syntaxhighlight>


<syntaxhighlight lang="html"><span class="plainlinks link-target-self">[{{SERVER}}/wiki/Main_Page?name={{CURRENTUSER}} Send me home with my name as URL parameter]</span></syntaxhighlight>
See: [https://www.mediawiki.org/wiki/Extension:UrlGetParameters Extension:UrlGetParameters]
<span class="plainlinks link-target-self">[{{SERVER}}/wiki/Main_Page?name={{CURRENTUSER}} Send me home with my name as URL parameter]</span>

Latest revision as of 13:06, 13 March 2024

Internal Links[edit | edit source]

[[Main Page|Send me home]]

Example: Send me home

External Links[edit | edit source]

[https://webmo.info WebMo Website]

Example: WebMo Website

External Links that behave like internal links[edit | edit source]

This is useful if you have a link with URL parameters. Note CSS class="plainlinks" in the <span>-wrapper:

This class comes with MediWiki core and hides the symbol for external links.

In addition this class is configured in LocalSeetings.php for Extension:LinkTarget and overwrites the standard behavior for external links (opens in the same browser tab instead of a new one).

Note: For external links you need to use an underscore (_) for pagenames with spaces (Main_Page instead of Main Page).

<span class="plainlinks">[{{SERVER}}/wiki/Main_Page?name={{CURRENTUSER}} Send me home with my name as URL parameter]</span>

Example: Send me home with my name as URL parameter

Note: At target page URL parameters can be used as follows:

{{#urlget:parameter-name|default-value}}

See: Extension:UrlGetParameters