Meryam Sahin (talk | contribs) Created page with "<bookshelf src="Book:User manual" /> {{DISPLAYTITLE:Insert links}} ==How do I create links?== Linking pages is an important feature of browser-based documentation. The links can differ in their function. Links connect wiki pages with: *other wiki pages *external websites *files (images, PDF files, Word documents,...)<br /> Use the ''Insert link'' menu item in VisualEditor or use the shortcut ''Ctrl+K''. In both cases, a dialog box open..." |
Meryam Sahin (talk | contribs) No edit summary |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
< | <status color="green" light="true">done</status> <br> | ||
Links connect wiki pages with related content, external websites, and files. | |||
== Create links == | |||
To create a link, select the '''Insert link''' option in the visual editor or press <code>Ctrl+K</code>. A dialog opens where you can select the type of link and specify the link target.<br>[[File:visualeditor-insert-link-dialog.png|alt=Dialog box with a link to the page "Templates"|center|thumb|Linking pages]]<br> | |||
VisualEditor supports the following link types: | |||
*'''Wiki link''': Link to a page in the current wiki or to a page in another wiki in the BlueSpice Galaxy. | |||
*'''External link''': Link to a page on an external website. | |||
*'''Link to file''': Link to a file description page in the wiki. | |||
===Link to a wiki page=== | |||
Wiki links connect pages within the current wiki or to pages in another wiki in the BlueSpice Galaxy. <br> | |||
[[File: | '''Create a wiki link''': | ||
#Select the text that should become the link. | |||
==Link to a wiki page== | #Select '''Insert link''' or press <code>Ctrl+K</code>. | ||
#In the '''Search pages''' field, enter the name of the target page. | |||
#Select the target page from the serach results. | |||
#Select '''Done'''. <br> | |||
If text is selected before opening the link dialog, VisualEditor uses the selected text as the link text and suggests matching pages. <br> | |||
The search results show the wiki, namespace, and parent page of the target page. This information helps identify the correct page when pages with the same name exist in different wikis or namespaces. | |||
====Wiki link syntax in wikitext==== | |||
When a wiki link is created in VisualEditor, it is stored in wikitext using the following syntax: | |||
*'''Link to a wiki page:''' <code><nowiki>[[Page name|link text]]</nowiki></code> | |||
< | *'''Link to a page in another namespace:''' <code><nowiki>[[Namespace name:Page name|link text]]</nowiki></code> | ||
*'''Link to a category page:''' <code><nowiki>[[:Category name|link text]]</nowiki></code> | |||
For a category link, the colon before <code>Category:</code> is required. Without the colon, the page is assigned to the category instead of creating a link to the category page. | |||
*'''Link to a wiki page:''' <code><nowiki>[[ | *'''Link to a page in another wiki:''' The syntax depends on the interwiki configuration of the wiki. VisualEditor can be used to create these links without entering the wikitext syntax manually. | ||
*'''Link to a | === Link to a page section === | ||
*'''Link to a category page:''' <code><nowiki>[[:Category | A page section can be linked directly using an anchor. <br> | ||
*''' | '''Link to a page section''': | ||
#Open the page containing the section. | |||
== Link to a page section == | #In view mode, hover over the section heading and select the link icon that appears next to the heading. This copies the anchor link to the clipboard. | ||
#Open the '''Insert link''' dialog in the page where the link should be added. | |||
#Paste the anchor link into the link field using <code>Ctrl+V</code>. | |||
# In view mode, | #Select '''Insert'''. | ||
[[File:visualeditor-anchor-link.png|alt=Mouse pointer hovering over the anchor icon next to a section heading|center|thumb|200x200px|Anchor link]] | |||
===Link to an external website=== | |||
==Link to an external website== | '''Create an external link''': | ||
#Select the text that should become the link. | |||
[[File: | #Select '''Insert link''' or press <code>Ctrl+K</code>. | ||
{{ | #Select the '''External link''' tab. | ||
#Enter the web address. | |||
==Link to a file page in the wiki== | #Select '''Insert'''. | ||
[[File:visualeditor-external-link.png|alt=External link tab with a link to wikipedia.org|center|thumb|300x300px|Linking to an external website]] | |||
[[File: | {{Textbox|boxtype=note|header=Note:|text=Use [[Special:LinkSearch]] to find external links in the wiki. The page also provides access to the related MediaWiki help page.}} | ||
{{Textbox|boxtype=note|header= | ===Link to a file page in the wiki=== | ||
==Open internal links in new browser tab== | '''Create a link to a file page''': | ||
By default, external links open in a new browser tab. | #Select the text that should become the link. | ||
#Select '''Insert link''' or press <code>Ctrl+K</code>. | |||
#Select the '''Link to file''' tab. | |||
#Search for and select the file. | |||
#Select '''Insert'''. | |||
[[File:visualeditor-link-to-file.png|alt=Insert link dialog with the Link to file tab|center|thumb|300x300px|Insert link to a file]] | |||
{{Textbox|boxtype=note|header=Note:|text=To create a link that opens a file directly, such as a PDF, use '''Insert''' > '''Images and media''' instead of '''Insert link'''.|icon=yes}} | |||
==Permalinks== | |||
A permalink is a link to a specific revision of a page. Unlike a regular page URL, a permalink continues to point to the selected revision even if the page is edited or moved. <br> | |||
'''Copy a permalink for the current page revision''': | |||
#Open the page revision for which the permalink is needed. | |||
#Select '''Copy URL''' in the '''More page actions''' toolbar. <br> | |||
[[File:share-page-copy-url.png|alt=Expanded Share page menu with the Copy URL option|center|thumb|300x300px|Copy the permalink]] | |||
'''Copy a permalink from the version history''': | |||
#Select '''Past revisions of this page''' in the '''Titles action''' toolbar. | |||
#Select the date of the required revision. | |||
#Copy the URL from the browser address bar. | |||
[[File:version-history-copy-url.png|center|thumb|650x650px|Copy the permalink from the version history|alt=Browser address bar showing the URL of a specific page revision]] | |||
The permalink contains the revision ID of the selected page version. It continues to work if the page is moved to a different name. | |||
=== Internal permalinks === | |||
An internal permalink can be added to a page as a link. This allows a specific page revision to be referenced directly from another page.<br> | |||
'''Create an internal permalink''': | |||
#Open the [[Special:PermanentLink]] special page for the required revision. | |||
#In VisualEditor, select '''Insert link''' or press <code>Ctrl+K</code>. | |||
#Enter or paste the permalink. | |||
#Select '''Insert'''. | |||
[[File:visualeditor-insert-permalink.png|alt=Insert link dialog for a PermanentLink|center|thumb|350x350px|Insert an internal permalink]] | |||
==Advanced configuration== | |||
===Open internal links in a new browser tab=== | |||
By default, external links open in a new browser tab. Internal links open in the current tab. To open selected internal links in a new browser tab, an administrator can add custom JavaScript to the <code>MediaWiki:Common.js</code> page. <br> | |||
Add the following code to <code>MediaWiki:Common.js</code>: | |||
<syntaxhighlight lang="javascript"> | |||
/** | /** | ||
* @source https://www.mediawiki.org/wiki/Snippets/Open_specific_links_in_new_window | * @source https://www.mediawiki.org/wiki/Snippets/Open_specific_links_in_new_window | ||
| Line 57: | Line 88: | ||
} ); | } ); | ||
} ); | } ); | ||
</syntaxhighlight> | </syntaxhighlight><br> | ||
To apply this behavior to a link, add the <code>newwin</code> class to the link in wikitext.<br> | |||
For example: <syntaxhighlight lang="wikitext"> [[Page name]] </syntaxhighlight> | |||
[[ | |||
</syntaxhighlight> | |||
Latest revision as of 14:26, 19 August 2026
done
Links connect wiki pages with related content, external websites, and files.
Create links
To create a link, select the Insert link option in the visual editor or press Ctrl+K. A dialog opens where you can select the type of link and specify the link target.
VisualEditor supports the following link types:
- Wiki link: Link to a page in the current wiki or to a page in another wiki in the BlueSpice Galaxy.
- External link: Link to a page on an external website.
- Link to file: Link to a file description page in the wiki.
Link to a wiki page
Wiki links connect pages within the current wiki or to pages in another wiki in the BlueSpice Galaxy.
Create a wiki link:
- Select the text that should become the link.
- Select Insert link or press
Ctrl+K. - In the Search pages field, enter the name of the target page.
- Select the target page from the serach results.
- Select Done.
If text is selected before opening the link dialog, VisualEditor uses the selected text as the link text and suggests matching pages.
The search results show the wiki, namespace, and parent page of the target page. This information helps identify the correct page when pages with the same name exist in different wikis or namespaces.
Wiki link syntax in wikitext
When a wiki link is created in VisualEditor, it is stored in wikitext using the following syntax:
- Link to a wiki page:
[[Page name|link text]] - Link to a page in another namespace:
[[Namespace name:Page name|link text]] - Link to a category page:
[[:Category name|link text]]
For a category link, the colon before Category: is required. Without the colon, the page is assigned to the category instead of creating a link to the category page.
- Link to a page in another wiki: The syntax depends on the interwiki configuration of the wiki. VisualEditor can be used to create these links without entering the wikitext syntax manually.
Link to a page section
A page section can be linked directly using an anchor.
Link to a page section:
- Open the page containing the section.
- In view mode, hover over the section heading and select the link icon that appears next to the heading. This copies the anchor link to the clipboard.
- Open the Insert link dialog in the page where the link should be added.
- Paste the anchor link into the link field using
Ctrl+V. - Select Insert.
Link to an external website
Create an external link:
- Select the text that should become the link.
- Select Insert link or press
Ctrl+K. - Select the External link tab.
- Enter the web address.
- Select Insert.
Link to a file page in the wiki
Create a link to a file page:
- Select the text that should become the link.
- Select Insert link or press
Ctrl+K. - Select the Link to file tab.
- Search for and select the file.
- Select Insert.
Permalinks
A permalink is a link to a specific revision of a page. Unlike a regular page URL, a permalink continues to point to the selected revision even if the page is edited or moved.
Copy a permalink for the current page revision:
- Open the page revision for which the permalink is needed.
- Select Copy URL in the More page actions toolbar.
Copy a permalink from the version history:
- Select Past revisions of this page in the Titles action toolbar.
- Select the date of the required revision.
- Copy the URL from the browser address bar.
The permalink contains the revision ID of the selected page version. It continues to work if the page is moved to a different name.
Internal permalinks
An internal permalink can be added to a page as a link. This allows a specific page revision to be referenced directly from another page.
Create an internal permalink:
- Open the Special:PermanentLink special page for the required revision.
- In VisualEditor, select Insert link or press
Ctrl+K. - Enter or paste the permalink.
- Select Insert.
Advanced configuration
Open internal links in a new browser tab
By default, external links open in a new browser tab. Internal links open in the current tab. To open selected internal links in a new browser tab, an administrator can add custom JavaScript to the MediaWiki:Common.js page.
Add the following code to MediaWiki:Common.js:
/**
* @source https://www.mediawiki.org/wiki/Snippets/Open_specific_links_in_new_window
* @version 2018-09-15
*/
$( function () {
$( '#mw-content-text' ).on( 'click', '.newwin > a', function () {
var otherWindow = window.open();
otherWindow.opener = null;
otherWindow.location = this;
return false;
} );
} );
To apply this behavior to a link, add the newwin class to the link in wikitext.
For example:
[[Page name]]