Modul:Marker/Params

Aus Wikivoyage
Zur Navigation springen Zur Suche springen
Template-info.png Dokumentation für das Modul Marker/Params[Ansicht] [Bearbeiten] [Versionsgeschichte] [Aktualisieren]

Dieses Modul enthält eine Parametertabelle für den Aufruf von Karten-Markern, und zwar für die Vorlage {{Marker}}.

Versionsbezeichnung auf WikiData: 2020-08-04

Benötigte weitere Module

Dieses Modul benötigt folgende weitere Module: Failsafe
Hinweise
-- module interface
local Params = {
	suite  = 'Marker',
	sub    = 'Params',
	serial = '2020-08-04',
	item   = 65451902
}

-- module import
local fs = require( 'Module:Failsafe' )

-- Parameter lists and localization
return {
	-- The item key like ['no-gpx'] is the parameter name used in the template.
	-- The value is used by the Marker module. Use key strings for localization.
	p = {
		-- template arg = module name
		alt             = 'alt',
		commonscat      = 'commonscat',
		format          = 'format',
		group           = 'group',
		image           = 'image',
		lat             = 'lat',
		long            = 'long',
		['map-group']   = 'mapGroup',
		['no-gpx']      = 'noGpx',
		name            = 'name',
		['name-extra']  = 'nameExtra',
		show            = 'show',
		styles          = 'styles',
		symbol          = 'symbol',
		text            = 'text',
		type            = 'type',
		url             = 'url',
		wikidata        = 'wikidata',
		zoom            = 'zoom'
	},

	-- corresponding Wikidata properties
	wd = {
		coord      = { p =  'P625' },
		iata       = { p =  'P238' },
		icao       = { p =  'P239' },
		image      = { p =   'P18' },
		rss        = { p = 'P1019' },
		type       = { p =   'P31' },
		url        = { p =  'P856' },

		facebook   = { p = 'P2013', f = 'https://www.facebook.com/%s' },
		flickr     = { p = 'P3267', f = 'https://www.flickr.com/photos/%s' },
		instagram  = { p = 'P2003', f = 'https://www.instagram.com/%s/' },
		twitter    = { p = 'P2002', f = 'https://twitter.com/%s' },
		youtube    = { p = 'P2397', f = 'https://www.youtube.com/channel/%s' },
	},

	-- default Wikidata requests
	-- iata, icao, rss, social media links only from Wikidata
	wdContent = {
		coord      = false, -- internal use, don't change
		name       = false, -- internal use, don't change

		iata       = true,  -- fetch it by default
		icao       = true,
		image      = true,
		rss        = true,
		url        = true,

		facebook   = false, -- don't fetch it by default
		flickr     = false,
		instagram  = false,
		twitter    = false,
		youtube    = false
	},

	-- check for fetch from Wikidata
	ynCheckList = { 'facebook', 'flickr', 'iata', 'icao', 'image', 'instagram',
		'rss', 'twitter', 'youtube', 'url' },
	socialMedia = { 'facebook', 'flickr', 'instagram', 'twitter', 'youtube' },

	-- format patterns
	formats = {
		allowed = '^f2$',
		coord   = '^f[1345]$',
		default = 'f0',
		name    = '^f[0146]$',
		poi     = '^f[0-3]$', -- marker symbol
		poiMode = 'f2'
	},
	defaultShow = 'poi',

	-- parameters for wrapper tag
	markerData = {
		color           = 'data-color',
		commonscat      = 'data-commonscat',
		group           = 'data-group',
		groupTranslated = 'data-group-translated',
		image           = 'data-image',
		mapGroup        = 'data-map-group',
		nameLocal       = 'data-name-local',
		rss             = 'data-rss',
		symbol          = 'data-symbol',
		type            = 'data-type',
		url             = 'data-url',
		wikidata        = 'data-wikidata',
		wikiLang        = 'data-wikilang'		
	},

	-- possible values for show parameter
	show = {
		all         = '',
		coord       = '',
		noname      = '',
		noairport   = '',
		none        = '',
		poi         = '',
		socialmedia = '',
		symbol      = ''
	},

	-- module administration
	Params = function()
		return Params
	end,

	failsafe = function( version )
		return fs._failsafe( version, Params ) or ''
	end
}