Extension:PageProperties/pl

From mediawiki.org
This page is a translated version of the page Extension:PageProperties and the translation is 7% complete.
Other languages:
Podręcznik rozszerzeń MediaWiki
OOjs UI icon advanced-invert.svg
PageProperties
Status wydania: stabilne
Realizacja Hak , Strona specjalna
Opis Allows to easily edit display title, language and content model of a page. To associate semantic properties to pages without having to manually annotate them (provided that Semantic MediaWiki is installed), and to set SEO meta data for the entire wiki or specific pages
Autor(zy) (thomas-topway-itdyskusja)
Ostatnia wersja 1.0.3 (2022-07-28)
MediaWiki >= 1.35.0
Licencja GNU General Public License 2.0 or later
Pobieranie
Przetłumacz rozszerzenie PageProperties jeżeli jest dostępne na translatewiki.net

Sprawdź wykorzystywanie i matrycę wersji.

PageProperties allows to easily edit display title, language and content model of a page. To associate semantic properties to pages without having to manually annotate them (provided that Semantic MediaWiki is installed), and to set SEO meta data for the entire wiki or specific pages.

The extension adds an action on the top menu of Wiki articles and then authorized users can set all the relevant properties of the page.

PageProperties-screenshot-menu.png

Installation

  • Download and place the file(s) in a directory called PageProperties in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php
wfLoadExtension( 'PageProperties' );
  • Run php maintenance/update.php (this will install the required tables)
  • optionally run composer update --no-dev in the extension's folder, this will install the required libraries to annotate JSON-LD within the page (see section below to find out more)
  • Yes Zrobione – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


JSON-LD

JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding linked data using JSON (from Wikipedia). PageProperties automatically includes the ontology associated with the page, if any, in the following form

{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "homepage": {
      "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage",
      "@type": "@id"
    },
    "Person": "http://xmlns.com/foaf/0.1/Person"
  },
  "@id": "https://me.example.com",
  "@type": "Person",
  "name": "John Smith",
  "homepage": "https://www.example.com/"
}

Of course the feature is especially useful when PageProperties is used in conjunction with Semantic MediaWiki, and when the page includes semantic properties, especially, for the purpose of search engine optimization, semantic properties imported from the schema.org vocabulary.

See here for more information how Google handles that. Here are the properties expected by Google for an item of type "book", so in order to have a wiki page recognized by Google as a book, you have to do the following steps:

  • import the schema.org vocabulary as shown here
  • associate the local properties of the wiki to schema.org properties. (see here, in case of the book title use [[Imported from::schema:name]] within a local property named for instance Property:Book_title
  • associate the category Books to the schema.org item type "book" entering [[Imported from::schema:Book| ]] in the category's page
  • create more local properties to define a book and associate each of them to the schema.org vocabulary following this reference
  • that's it! Now your book item in the wiki is fully recognizable by search engines or other platforms for linked data and highly accessible on the Web!



Features

Main

From the main tab you can edit the display title of the page, language and content model. The display title can be left blank to hide the title completely without having to deal with css tricks.

PageProperties-screenshot-main.png


Semantic properties

From the Semantic properties tab you can register semantic properties to the related page without annotating them manually. Same properties can have multiples values, and they will be handled correctly by askqueries and shown on the FactBox. (see #Known issues for further details)

The list of available semantic properties includes, in order to prevent inconsistencies, all user-defined semantic properties which are not already annotated in the page, plus all annotable and non-declarative SMW's special properties.

PageProperties-screenshot-semantic-properties.png

PageProperties-screenshot-factbox.png


SEO

PageProperties-screenshot-dropdown.png

From the SEO tab you can easily add meta tags or properties to specific pages or the entire wiki.

If the extension Extension:wikiSEO is installed, PageProperties will show a combobox with the parameters allowed by the extension, and they will be internally handled by the WikiSEO extension itself without the need to manually annotate them on the page.

Note that the checkbox "apply to entire wiki" will be only shown if the properties are related to the Main Page of the wiki.

PageProperties-screenshot-SEO.png

Configuration

$wgPagePropertiesAuthorizedEditors controls users and groups allowed to edit page properties. Place in LocalSettings.php as follows to allow all logged-in users to edit page properties. By default only sysops are allowed. The list accepts both usernames and groups.

$wgPagePropertiesAuthorizedEditors = [ 'user' ];

If SemanticMediaWiki is not installed the extension works as expected and the "Semantic properties" tab will be omitted.

If WikiSEO is not installed the extension works as expected and the SEO meta tag or properties have to be entered using their complete syntax. For instance article:author instead of author and og:title instead of title.

Known issues

SMW's factbox may not display the properties set from the extension (while they will be handled correctly by askqueries). You can monitor the state of the ticket on Github.

Before the issue is solved just edit the function fetchContent in the file extensions/SemanticMediaWiki/src/Factbox/Factbox.php as below

// ***edited
		if ( true || $semanticData === null || $semanticData->stubObject || $this->isEmpty( $semanticData ) ) {
			$semanticData = $this->store->getSemanticData( $this->parserData->getSubject() );
		}

Also, the combobox of Mediawiki's OOUI library does not display optgroups correctly on menus (i.e. they will not show as in this picture). I will propose/commit a patch as soon as possible to the official library.

Support & bugs

Please post error messages in the Talk page of the extension. Updates will be posted on the main MediaWiki mailing list mediawiki-l so we advice you to subscribe to the list to stay tuned with them.



Zobacz też