Modul:Article/config: Unterschied zwischen den Versionen

Permanently protected module
ZIM HilfeWiki - das Wiki
Zeile 17: Zeile 17:
  
 
-- list of all possible parameters
 
-- list of all possible parameters
local allParams = { 'disambiguation', 'type', 'os', 'service', 'targetgroup', 'pagetype' }
+
local allParams = { 'disambiguation', 'displaytitle', 'type', 'os', 'service', 'targetgroup', 'pagetype' }
  
 
-- list of all mandatory fields
 
-- list of all mandatory fields

Version vom 13. April 2023, 07:29 Uhr

Documentation icon Module documentation

This module provides configuration data for Module:Article. See comments for configuration options.

-- a table to control the module behavior in certain aspects
local control = {
	useAutomatedOsFamilyDetection = true,
	validateParamOs = true,
	validateParamService = true,
	fallbackIBType = 'any',
	-- this is the category in which articles will be placed if they don't have have a type->category association in type2category
	fallBackCategory = 'Artikel',
	-- this is the category in which articles with incorrect parameter-call will be placed (i.e. non valid mandatory-missing)
	errorCategory = 'Articles with erroneous input',
	displayDefaultAs = 'Alle',
	idForParentField = 'breadcrumb_parent_pageName'
}

-- list of all parameters, that are multivalue fields
local multivalues = { 'os', 'service', 'targetgroup' }

-- list of all possible parameters
local allParams = { 'disambiguation', 'displaytitle', 'type', 'os', 'service', 'targetgroup', 'pagetype' }

-- list of all mandatory fields
local mandatory = { 'type' }

-- if disambiguation for article exists, this text will be pritned before the link to the disambiguation page
local hatnote = 'For other articles about this topic, see '

-- for manual plausibility check, list all possible values for a given parameter here
local validValues = {
	type = { 'Anleitung', 'FAQ', 'Information', 'Policy' },
	targetgroup = { 'Angestellte', 'Bereiche', 'Besucher', 'Gäste', 'Studierende' }
}

-- these are the default values for a omitted non-mandatory (i.e. optional) parameter
-- note: use strings or integers for singlevalue fields and tables for multivalues (see above `local multivalues=`)
local defaultValues = {
	type = 'Anleitung',
	os = {'Any'},
	portal = {'Alle'},
	service = {'Service:Alle'},
	targetgroup = { 'Studierende', 'Angestellte', 'Gäste' }
}

-- setting parameter in template call to one of these values results in it being set to the default value
-- defined in defaultValues and displayed as control.displayDefaultAs
local fallBack2default = {
	['Any'] = true,
	['Alle'] = true,
	['Service:Any'] = true,
	['Service:Alle'] = true
}

-- a table that converts argument names to property names
-- only holds parameter names whos content will be stored in properties automatically-ish. parameters like pagetype needs to be processed
local arg2prop = {
	disambiguation = 'is disambiguated by',
	displaytitle = 'has display title',
	type = 'is of type',
	os = 'is related to os',
	service = 'is associated to service',
	targetgroup = 'is written for target audience'
}

-- a table that converts an article type into the corresponding category
-- fallback is configured in control.fallBackCategory
local type2category = {
	Anleitung = 'Anleitungen',
	FAQ = 'FAQs',
	Information = 'Informationen',
	Policy = 'Policys'
}

-- a table for manual os to os family conversion. will be used, if 'useAutomatedOsFamilyDetection' is set to false in table _CFG.control
-- basically this is a manual (and therefore maintence prone) representation of the query
-- {{#ask:[[Category:Betriebssysteme]]|?is member of os family|header=plain|link=none}}
local os2osfamily = {
	linux = 'linux'
}
os2osfamily['android 2.3 (gingerbread)'] = 'android'
os2osfamily['android 3 (honeycomb)'] = 'android'
os2osfamily['android 4.0 (ice cream sandwich)'] = 'android'
os2osfamily['android 4.1-4.3 (jelly bean)'] = 'android'
os2osfamily['android 4.4 (kitkat)'] = 'android'
os2osfamily['blackberry 10'] = 'blackberry'
os2osfamily['ios 4'] = 'ios'
os2osfamily['ios 5'] = 'ios'
os2osfamily['ios 6'] = 'ios'
os2osfamily['ios 7'] = 'ios'
os2osfamily['ios 8'] = 'ios'
os2osfamily['macos x 10.10 (yosemite)'] = 'macos'
os2osfamily['macos x 10.6 (snow leopard)'] = 'macos'
os2osfamily['macos x 10.7 (lion)'] = 'macos'
os2osfamily['macos x 10.8 (mountain lion)'] = 'macos'
os2osfamily['windows 7'] = 'windows'
os2osfamily['windows 8'] = 'windows'
os2osfamily['windows 10'] = 'windows'
os2osfamily['windows 11'] = 'windows'
os2osfamily['windows phone 8.1'] = 'windows phone'
os2osfamily['windows vista'] = 'windows'
os2osfamily['windows xp'] = 'windows'

-- basis fields for infobox layouts depending on the selected os family
local ibCoreData = {	-- inboxbox core data indexes all in lowercase
	any = {
		label = 'Allgemeine Informationen',
		image = '',
		portal = '[[HilfeWiki des IMT der Uni Paderborn]]'
	},
	android = {
		label = 'Android',
		image = '[[Datei:Logo_Android.png|alt=Android|link=]]',
		portal = '[[Android|Android Portalseite]]'
	},
	blackberry = {
		label = 'Blackberry',
		image = '',
		portal = '[[Blackberry|Blackberry Portalseite]]'
	},
	chromeos = {
		label = 'Chrome OS',
		image = '[[Datei:Logo_ChromeOS.png|alt=Chrome OS|link=]]',
		portal = '[[ChromeOS|Chrome OS]]'
	},
	ios = {
		label = 'Apple iOS',
		image = '[[Datei:Logo_iOS.png|alt=Apple iOS|link=]]',
		portal = '[[iOS|iOS Portalseite]]'
	},
	linux = {
		label = 'Linux',
		image = '[[Datei:LogoTux.png|alt=Linux|link=]]',
		portal = '[[Linux|Linux Portalseite]]'
	},
	macos = {
		label = 'Apple MacOS',
		image = '[[Datei:Logo_OSX.png|alt=Apple MacOS|link=]]',
		portal = '[[MacOS|MacOS Portalseite]]'
	},
	windows = {
		label = 'Microsoft Windows',
		image = '[[Datei:Logo_Win.png|alt=Microsoft Windows|link=]]',
		portal = '[[Windows|Windows Portalseite]]'
	}
}
ibCoreData['windows phone'] = {
	label = 'Windows Phone',
	image = '',
	portal = '[[Windows Phone|Windows Phone Portalseite]]'
}

local cfg = {
	arg2prop = arg2prop,
	allParams = allParams,
	control = control,
	defaultValues = defaultValues,
	errorcategory = errorcategory,
	hatnote = hatnote,
	ibCoreData = ibCoreData,
	mandatory = mandatory,
	multivalues = multivalues,
	os2osfamily = os2osfamily,
	fallBack2default = fallBack2default,
	type2category = type2category,
	validValues = validValues
}

return cfg
Cookies helfen uns bei der Bereitstellung des ZIM HilfeWikis. Bei der Nutzung vom ZIM HilfeWiki werden die in der Datenschutzerklärung beschriebenen Cookies gespeichert.