dl / assetsource-mediawiki
MediaWiki Asset Source for Neos CMS
Installs: 3 159
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 2
Type:neos-package
Requires
- guzzlehttp/guzzle: ^6.3 || ^7.0
- neos/neos: ^4.1 || ^5.0 || ^7.0 || ^8.0
README
MediaWiki Asset Source
This asset source uses the public API of MediaWiki installations like the Wikipedia, MediaWiki Commons or any other Media Wiki instance to make the used assets searchable within a Neos installation.
Installation
Install the package via composer:
composer require dl/assetsource-mediawiki
Configuration
You can add arbitrary instances of this asset source, to query different wikimedia instances - e.g. the english and german instance. To do that, just add another configuration block with the specific settings under a custom identifier.
Example for accessing the german Wikipedia:
Neos: Media: assetSources: wikipedia_de: assetSource: 'DL\AssetSource\MediaWiki\AssetSource\MediaWikiAssetSource' assetSourceOptions: domain: de.wikipedia.org label: Wikipedia (DE) searchStrategy: DL\AssetSource\MediaWiki\Api\SearchStrategies\ArticleSearchStrategy searchStrategyOptions: articleLimit: 10 useQueryResultCache: true excludedIdentifierPatterns: - '*.svg'
Search Strategies
Searching in the wikipedia for images is a bit tricky. First there is not only one wikipedia instance, but one for each available language. Second an image can be stored in the language specific wikipedia or in Wikimedia Commons and included from there.
The package brings two different search strategies with different pros and cons.
Direct Image Search Strategy
searchStrategy: DL\AssetSource\MediaWiki\Api\SearchStrategies\DirectImageSearchStrategy
This search strategy uses the filename and available meta data like the description of an asset to search on. That means if you configure the commons.wikimedia.org
as domain, the package will search through about ~50 Million asssets available in all languages. But for historical reasons, some images are stored directly in the language specific wikipedia instances and therefore not available with that setting.
Article Search Strategy (Default)
searchStrategy: DL\AssetSource\MediaWiki\Api\SearchStrategies\ArticleSearchStrategy
This search strategy fits better to the Wikipedia use case. It doesn't search the images directly but uses the more powerfull article search to receive a number of wiki articles and then queries the images shown on that articles. The benefit is, if you configure the domain to en.wikipedia.org
you will get assets, that are uploaded directly to this instance, as well as all fitting assets uploaded to Wikimedia Commons
Usage of images in your project
Please take care of the correct attribution of used photos in the frontend.
Known Issues
See the issue list for known issues and missing features.