Extension:Display Title/de

This page is a translated version of the page Extension:Display Title and the translation is 39% complete.
Outdated translations are marked like this.
MediaWiki-Erweiterungen
Display Title
Freigabestatus: stabil
Einbindung Benutzer-Schnittstelle, Parser-Funktion
Beschreibung Verwendet die Seiteneigenschaft displaytitle im Linktext und im Titel der Gesprächsseite; zeigt optional den ursprünglichen Seitentitel als Untertitel an; und bietet eine Parser-Funktion zur Abfrage von displaytitle
Autor(en)
Letzte Version 4.0.2 (2023-07-26)
Kompatibilitätspolitik Snapshots werden zusammen mit MediaWiki veröffentlicht. Der Master ist nicht abwärtskompatibel.
MediaWiki 1.39+
PHP 7.4+
Composer mediawiki/display-title
Lizenz MIT-Lizenz
Herunterladen
  • $wgDisplayTitleFollowRedirects
  • $wgDisplayTitleExcludes
  • $wgDisplayTitleHideSubtitle
Quarterly downloads 63 (Ranked 90th)
Übersetze die Display Title-Erweiterung
Probleme Offene Aufgaben · Einen Fehler melden

Die Erweiterung "Display Title" ermöglicht es, den Anzeigetitel einer Seite als Standard-Link-Text in Links auf die Seite zu verwenden - sowohl Links von anderen Seiten als auch Links auf der Seite. Die Erweiterung Display Title passt auch den Seitennamen der zugehörigen Diskussionsseite an. Es zeigt optional den ursprünglichen Seitentitel als Untertitel auf der Seite an. Zudem bietet es eine Parser-Funktion für die Abfrage des Anzeigetitels einer Seite.

Die Erweiterung baut auf der Funktionalität im MediaWiki-Kern auf, die das Setzen des Anzeigetitels einer Seite mit dem DISPLAYTITLE Zauberwort unterstützt. Das Einfügen von {{{DISPLAYTITLE:My Display Title}}} auf einer Seite speichert den Anzeigetitel (in diesem Fall "My Display Title") in der Seiteneigenschaft displaytitle der MediaWiki-Tabelle page_props und zeigt diesen Wert auf der Seite als Titel in der Titelleiste an, sofern entsprechend konfiguriert. Um diese Funktion bereitzustellen fragt die Erweiterung Display Title den Wert displaytitle aus der Tabelle page_props ab.

Installation

  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens DisplayTitle im Ordner extensions/ ablegen.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/DisplayTitle
  • Folgenden Code am Ende deiner LocalSettings.php -Datei einfügen:
    wfLoadExtension( 'DisplayTitle' );
    
  • Konfiguriere nach Bedarf.
  •   Erledigt – Zu Special:Version in dem Wiki (bei Einstellung auf deutsch nach Spezial:Version) navigieren, um die erfolgreiche Installierung der Erweiterung zu überprüfen.

Konfigurationsparameter

Configuration flag Standardwert Beschreibung
$wgDisplayTitleHideSubtitle false Wenn falsch, zeige den Orignalseitennamen als Untertitel unterhalb der Titelzeile an.
$wgDisplayTitleExcludes [ ] Eine Reihe von Seitennamen, deren Seitennamen in Links nicht mit dem displaytitle ersetzt wird.
$wgDisplayTitleFollowRedirects true Defines whether redirects should be followed for displaying of the title.

While not strictly necessary for the functioning of Display Title, in order to allow the {{DISPLAYTITLE:...}} magic word to function as expected, set the following MediaWiki core configuration variables:

$wgAllowDisplayTitle = true; // defaults to true
$wgRestrictDisplayTitle = false; // defaults to true

Display title auf Bearbeiten Seiten und Links auf Bearbeiten Seiten

In order for the Display Title to be used on edit pages and links to them, edit the following system messages on your wiki (substituting the wiki's local language where appropriate):

System Message Page Name Alter Seiteninhalt Neuer Seiteninhalt
MediaWiki:Editing Editing $1 Editing {{#if: {{NAMESPACE}} | {{NAMESPACE}}: |}}{{#getdisplaytitle:{{SUBJECTPAGENAME}}}}
MediaWiki:Editingcomment Editing $1 (new section) Editing {{#if: {{NAMESPACE}} | {{NAMESPACE}}: |}}{{#getdisplaytitle:{{SUBJECTPAGENAME}}}} (new section)
MediaWiki:Editingsection Editing $1 (section) Editing {{#if: {{NAMESPACE}} | {{NAMESPACE}}: |}}{{#getdisplaytitle:{{SUBJECTPAGENAME}}}} (section)
MediaWiki:Editsectionhint Edit section: $1 Edit section: {{#if: {{NAMESPACE}} | {{NAMESPACE}}: |}}{{#getdisplaytitle:{{SUBJECTPAGENAME}}}}
MediaWiki:Creating Creating $1 Creating {{#if:{{NAMESPACE}}|{{NAMESPACE}}:}} {{#getdisplaytitle: {{SUBJECTPAGENAME}} }}

And if you also use Page Forms .

System Message Page Name Alter Seiteninhalt Neuer Seiteninhalt
MediaWiki:Pf formedit createtitle Create $1: $2 Create $1: {{#if:{{NAMESPACE}}|{{NAMESPACE}}:}} {{#getdisplaytitle: {{SUBJECTPAGENAME}} }}
MediaWiki:Pf formedit edittitle Edit $1: $2 Edit $1: {{#if:{{NAMESPACE}}|{{NAMESPACE}}:}} {{#getdisplaytitle: {{SUBJECTPAGENAME}} }}

Verwendung

Linking

The behavior of the Display Title extension for different types of links is summarized below. The table shows what the link text will be for different situations. In the table, A represents a page title and a represents the page title with the first character of the page name (i.e. the part after the Namespace: if there is a namespace) in lower case. Note that if a page is a redirect (i.e. Page A in the "Page A Redirects to Page B" columns below) and has a display title set, that display title will be ignored by this extension.

Link auf der Quellseite: Seite A hat keine Weiterleitung Seite A hat eine Weiterleitung
Seite A hat keinen Display Title Seite A hat den Display Title Z Seite B hat keinen Dispaly Title Seite B hat den Display Title Y
[[A]] A Z B Y
[[a]] a
[[A | A]] A Z B Y
[[a | A]] A Z B Y
[[A | a]] a
[[a | a]] a
[[A | X]] X
[[a | X]] X

<span id="#getdisplaytitle_parser_function">

#getdisplaytitle Parser Funktion

Die #getdisplaytitle Parser Funktion holt den Display Title der angegebenen Seite. Zum Beispiel:

{{#getdisplaytitle:Book:42}}

Zeigt den Display Title von Seite Book:42 an. Um den Display Title der gegenwärtigen Seite anzuzeigen, benutze:

{{#getdisplaytitle:{{FULLPAGENAME}}}}

Unterstützung für Lua/Scribunto

Für Lua(siehe Erweiterung:Scribunto ) existieren zwei Funktionnen um den Display Title zu erhalten oder zu setzen: mw.ext.displaytitle.get() und mw.ext.displaytitle.set() Um sie zu benutzen, erstelle eine Seite Module:DisplayTitle mit dem folgenden Inhalt:

local p = {}

function p.set(frame)
	return mw.ext.displaytitle.set(frame.args[1])
end

function p.get(frame)
	return mw.ext.displaytitle.get(frame.args[1])
end

return p

You could then use {{#invoke:DisplayTitle|set|My Display Title}} on a page to set the page's display title to My Display Title, and you could use {{#invoke:DisplayTitle|get|My Page}} to get the display title of page My Page.

Weiterleitungen

For redirect pages, if the target page has a display title, it will be used as the display title of the redirect page.

Note that this has two implications that may be unexpected the first time a user sees them. When a page with a display title is moved leaving a redirect, on the page indicating that the move was a success the link text will be the same for both the source and target pages. And, on the Special:WhatLinksHere page for a page with a display title that is the target of a redirect, the link text of the redirect page will be the display title of the target page.

A single level of redirect will be followed.

Geschichte

The functionality in this extension evolved as part of the Semantic Title extension. Special thanks go to Van de Bugger, the author of version 1.0 of Semantic Title.

Display Title relies only on functionality in MediaWiki core; it does not depend on any other extension. The functionality in Display Title has been removed from Semantic Title, which now retains solely the functionality to set a page's display title from a Semantic MediaWiki property or Cargo field. However, it is recommended that a page's display title be set using {{DISPLAYTITLE:...}} rather than the functionality in Semantic Title. Semantic Title is being maintained for backward compatibility.

Veröffentlichungshinweise

Version 4.0.2
Version 4.0.1
  • Fix title handling in hooks (T342672)
  • Revert user preference to disable the extension due to a bug (T342727) and since the current approach introduces latency and risk
Version 4.0.0
  • Drop support for MediaWiki 1.38 and earlier
  • Add mw-displaytitle-subtitle class to subtitle (T205250)
  • Fix subpage subtitles for subpages more than two levels deep (T188872)
  • Fix redirect subtitle so it does not use the displaytitle (T306459)
  • Add name and description properties to composer.json (T311321)
  • Add a user preference to disable the extension (T217179)
  • Coding style and test improvements
Version 3.3
  • Do not remove fragments if not proper part of text
  • Change PersonalUrls hook to SkinTemplateNavigation::Universal hook
  • Replace deprecated WikiPage::factory/Use WikiPageFactory
Version 3.2
  • Add config option for changing redirect display ($wgDisplayTitleFollowRedirects)
  • Replace deprecated PageProps::getInstance
Version 3.1
  • Fix incompatibility with the Cite extension
Version 3.0
  • Several fixes to anchor/fragment behavior
  • Updates due to code deprecations in MediaWiki
  • Compatibility dropped with MW 1.34 and lower
Version 2.2.0
  • Add $wgDisplayTitleExcludes array to define a list of pages on which links should not use DisplayTitle
  • Fix behavior when there are underscores in the link text
  • Don't use deprecated ParserBeforeStrip hook
Version 2.1.0
  • Added tests
  • Added null title check
Version 2.0.0
  • Compatibility dropped with MW 1.28 and lower
  • Bug fixes:
    • T181669: Handle integers passed as link text
    • Fixed bug introduced in version 1.5.2 that caused self links to be wrapped in HtmlArmor
Version 1.5.3
  • On redirect pages, show display title of target page
    • Follows a single level of redirect
Version 1.5.2
  • Bug fixes:
    • T180413: Use supplied link text rather than display title when link text matches page title except for case of first character
    • T180409: Undefined variable: found in "DisplayTitleHooks.php" on line 152
    • T181228: Display titles with italics show as HTML
Version 1.5.1
  • Fixed issue for logged-in users on using action "info"
Version 1.5
  • Text that should have overridden link text was being ignored
  • Fix link to user page in header (personal URLs)
Version 1.4
  • Updated to work with MediaWiki 1.28+
Version 1.3
  • Modified self-links to determine display text identically to non-self-links
Version 1.2
  • Added mw.ext.displaytitle.get() and mw.ext.displaytitle.get() Lua functions written by User:Oetterer
Version 1.1
  • Added check for title with only fragment when creating link
Version 1.0
  • Initial release

Known incompatibilities

  • Configuration parameter $wgDisplayTitleHideSubtitle will not work if you also have the Semantic Breadcrumb Links extension lower than version 1.5.0 installed.

Thus the original page title will not display below the title bar.

Siehe auch