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:
<bookshelf src="Book:User manual" />
<status color="green" light="true">done</status> <br>
{{DISPLAYTITLE:Insert links}}
Links connect wiki pages with related content, external websites, and files.
 
== Create links ==
==How do I 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>
Linking pages is an important feature of browser-based documentation. The links can differ in their function. Links connect wiki pages with:
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.
*other wiki pages
*'''External link''': Link to a page on an external website.
*external websites
*'''Link to file''': Link to a file description page in the wiki.
*files (images, PDF files, Word documents,...)<br />
===Link to a wiki page===
Use the ''Insert link'' menu item in [[Manual:Extension/VisualEditor|VisualEditor]] or use the shortcut ''Ctrl+K''. In both cases, a dialog box opens.<br />
Wiki links connect pages within the current wiki or to pages in another wiki in the BlueSpice Galaxy. <br>
[[File:Insert link.png|alt=Dialog box with a link the page "Templates"|center|thumb|Linking pages]]
'''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>.
Internal links connect related pages or other content that provides more information. Page names can exist multiple times in different namespaces. Therefore, under ''Search pages'', enter the namespace if the destination page is not in the same namespace as the current page.
#In the '''Search pages''' field, enter the name of the target page.  
 
#Select the target page from the serach results.  
If you have selected some text on the page, you will find some page suggestions already listed in the ''Search pages'' tab. Here, you can adjust the search term accordingly or create a link to a new page.
#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>  
{{Textbox|boxtype=note|header=Note about the search feature:|text=Pages in the namespace are only found if you provide the namespace-prefix. For subpages, the parent page name also needs to be added in addition, before the subpage can be found.|icon=yes}}
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====
Then click on ''Done''.
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>
<span><span /><br /></span>
*'''Link to a page in another namespace:''' <code><nowiki>[[Namespace name:Page name|link text]]</nowiki></code>
In the source text, links are created with the following structure:
*'''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>[[landing page name|caption]]</nowiki></code>
*'''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 wiki page in another namespace:''' <code><nowiki>[[namespace:landing page name|caption]]</nowiki></code>
=== Link to a page section ===
*'''Link to a category page:''' <code><nowiki>[[:Category:category name|caption]]</nowiki></code> To create a link to a category, the source code is preceded by a colon before the category name. In contrast, the link "Category: BlueSpice" would create a category called BlueSpice instead of linking to the category BlueSpice.
A page section can be linked directly using an anchor. <br>
*'''[[Manual:Extension/BlueSpiceInterWikiLinks|Interwiki link]]:''' <code><nowiki>[[Imdb:tt2709692]]</nowiki></code>If your wiki links to other wikis, you can use the tab ''Search pages'' also to directly link to a page in a related wiki. For example, if your administrator maintains an interwiki link for the IMDb movie database, it can be typed in as in the example above. Ask your administrator which interwiki links are available in your wiki.
'''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.
You can link directly to a specific section of a page using an "anchor":
#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, click directly on the link icon to the left of the section heading (it appears when you hover over the heading). This copies the anchor to the clipboard.[[File:anchor link.png|alt=mouse pointer hovering over the anchor symbol|center|thumb|200x200px|Anchor link]]
#Select '''Insert'''.
# Paste the link from your clipboard into the dialog box for creating a link using <code>Ctrl</code>+<code>V</code>.
[[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''':
To link to an external website, mark text on your page, e.g. the word "Wikipedia". Press Ctrl+K and switch to the tab ''External link''. There you enter the web address. Then click ''Insert''.
#Select the text that should become the link.
[[File:External link.png|alt=External link tab with link to wikipedia.org|center|thumb|300x300px|Linking to an external page]]
#Select '''Insert link''' or press <code>Ctrl+K</code>.
{{Messagebox|boxtype=note|Note text=To easily maintain external links on your wiki, use the page [[Special:LinkSearch]]. This page allows you to search for external links in your entire wiki. The page also contains a link to the associated Mediawiki help page.}}
#Select the '''External link''' tab.
 
#Enter the web address.
==Link to a file page in the wiki==
#Select '''Insert'''.
To link to a file page (for example, the description page for a picture or a PDF), switch to the ''Link to File'' tab. There, you can search for a file.<br />
[[File:visualeditor-external-link.png|alt=External link tab with a link to wikipedia.org|center|thumb|300x300px|Linking to an external website]]
[[File:Links.png|alt=Insert link to a file|center|thumb|300x300px|Insert link to a 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=Linking directly to a PDF|text=To link a file directly (so that, for example, a PDF opens immediately after clicking on the link), insert the link by clicking on the menu item Insert and then Images and Media.|icon=yes}}
===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. If you also want to open individual internal links in a new tab, you can insert the following JavaScript on the ''MediaWiki:Common.js'' page:<syntaxhighlight lang="javascript">
#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>Add the link you want to open in a new tab as wikitext to your page.<syntaxhighlight lang="text">
</syntaxhighlight><br>
<span class="newwin">[[Meine Seite]]</span>
To apply this behavior to a link, add the <code>newwin</code> class to the link in wikitext.<br>
</syntaxhighlight>
For example: <syntaxhighlight lang="wikitext"> [[Page name]] </syntaxhighlight>
 
== Permalinks (revision-specific) ==
Every time a user saves changes to a page (revisions), a version with a specific version number is created. Therefore, each version  has its own web address (URL). This is also known as a permanent link or "permalink" and is accessible as follows:
 
# Via the "Share" link in the side toolbar. The permalink of the currently loaded page version is placed on the clipboard. Click on the "Share" icon and select "Copy URL".[[File:Toolbar Share URL.png|alt=The expanded "Share page" menu from the toolbar|center|thumb|300x300px|Copy the permanent link]]
 
# Via the "Version history". In the side toolbar, click "View history", then click a version's date stamp. The web address of the page now displays the permalink. [[File:Permalink version history.png|center|thumb|650x650px|Copy the permalink from the Version history|alt=Browser context menu for a specific page version]]
 
Both approaches create a permalink that depends on the name of the page:<syntaxhighlight lang="text">
https://en.wiki.bluespice.com/w/index.php?title=Manual:Extension/BlueSpiceInsertLink&oldid=5300
</syntaxhighlight>If the page is moved, and therefore has a different title, the permalink will still work based on the "oldid". {{Textbox|boxtype=tip|header=Tip:|text=In both cases, external links are created, for example for copying into an e-mail or another website. To create an internal permalink, you must create a link via the special page "PermanentLink" (see next section).|icon=yes}}
 
=== Internal permalink ===
A shortened permalink can be inserted in the source code of the page in the following way:<syntaxhighlight lang="text">
[[Special:PermanentLink/5300]]
</syntaxhighlight>Use the visual editor to enter the link using the link button ([[File:VE Insert hyperlink.png|alt=menu item "Insert link"|35x35px]]):
[[File:Permalink insert visually.png|alt=Dialog box for using the  "PermanentLink" syntax|center|thumb|350x350px|internal linking of a permalink]]
 
 
{{Box Links-en|Topic1=https://www.mediawiki.org/wiki/Help:Links |Topic2 = [[Manual:Extension/VisualEditor]]}}
 
{{translation}}
[[Category:Editing]]

Latest revision as of 14:26, 19 August 2026

done
Links connect wiki pages with related content, external websites, and files.

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.

Dialog box with a link to the page "Templates"
Linking pages


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.

Wiki links connect pages within the current wiki or to pages in another wiki in the BlueSpice Galaxy.
Create a wiki link:

  1. Select the text that should become the link.
  2. Select Insert link or press Ctrl+K.
  3. In the Search pages field, enter the name of the target page.
  4. Select the target page from the serach results.
  5. 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.

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.

A page section can be linked directly using an anchor.
Link to a page section:

  1. Open the page containing the section.
  2. 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.
  3. Open the Insert link dialog in the page where the link should be added.
  4. Paste the anchor link into the link field using Ctrl+V.
  5. Select Insert.
Mouse pointer hovering over the anchor icon next to a section heading
Anchor link

Create an external link:

  1. Select the text that should become the link.
  2. Select Insert link or press Ctrl+K.
  3. Select the External link tab.
  4. Enter the web address.
  5. Select Insert.
External link tab with a link to wikipedia.org
Linking to an external website
Note:Use Special:LinkSearch to find external links in the wiki. The page also provides access to the related MediaWiki help page.

Create a link to a file page:

  1. Select the text that should become the link.
  2. Select Insert link or press Ctrl+K.
  3. Select the Link to file tab.
  4. Search for and select the file.
  5. Select Insert.
Insert link dialog with the Link to file tab
Insert link to a file
Note:To create a link that opens a file directly, such as a PDF, use Insert > Images and media instead of Insert link.

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:

  1. Open the page revision for which the permalink is needed.
  2. Select Copy URL in the More page actions toolbar.
Expanded Share page menu with the Copy URL option
Copy the permalink

Copy a permalink from the version history:

  1. Select Past revisions of this page in the Titles action toolbar.
  2. Select the date of the required revision.
  3. Copy the URL from the browser address bar.
Browser address bar showing the URL of a specific page revision
Copy the permalink from the version history

The permalink contains the revision ID of the selected page version. It continues to work if the page is moved to a different name.

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:

  1. Open the Special:PermanentLink special page for the required revision.
  2. In VisualEditor, select Insert link or press Ctrl+K.
  3. Enter or paste the permalink.
  4. Select Insert.
Insert link dialog for a PermanentLink
Insert an internal permalink

Advanced configuration

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]]