Difference between revisions of "Module:Authority control files"

From blackwiki
Jump to navigation Jump to search
blackwiki>Tom.Reding
(group1 -> title)
blackwiki>Tom.Reding
(Only show the umbrella MusicBrainz ID)
Line 4: Line 4:
 
local nav  = require( 'Module:Navbox' )
 
local nav  = require( 'Module:Navbox' )
 
local conf = require( 'Module:Authority control' ).conf
 
local conf = require( 'Module:Authority control' ).conf
 +
local exclude = {
 +
['MBAREA'] = 'MBAREA',
 +
['MBI'] = 'MBI',
 +
['MBL'] = 'MBL',
 +
['MBP'] = 'MBP',
 +
['MBRG'] = 'MBRG',
 +
['MBS'] = 'MBS',
 +
['MBW'] = 'MBW',
 +
}
 
 
 
local elements = {}
 
local elements = {}
 
for _, c in pairs( conf ) do
 
for _, c in pairs( conf ) do
table.insert( elements, c[2] )
+
if exclude[c[1]] == nil then
 +
table.insert( elements, c[2] )
 +
end
 
end
 
end
 
 

Revision as of 19:21, 1 September 2019


About

This template is used to display wikilinks to all currently supported authority control IDs, automatically loaded from Module:Authority control's p.conf table.

Usage

{{Authority control files}}

See also




local p = {}

function p.files(frame)
	local nav  = require( 'Module:Navbox' )
	local conf = require( 'Module:Authority control' ).conf
	local exclude = {
		['MBAREA'] = 'MBAREA',
		['MBI'] = 'MBI',
		['MBL'] = 'MBL',
		['MBP'] = 'MBP',
		['MBRG'] = 'MBRG',
		['MBS'] = 'MBS',
		['MBW'] = 'MBW',
	}
	
	local elements = {}
	for _, c in pairs( conf ) do
		if exclude[c[1]] == nil then
			table.insert( elements, c[2] )
		end
	end
	
	return nav._navbox( {
			name        = 'Authority control files',
			navboxclass = 'authority-control-files',
			title       = '[[Authority control|Authority control files]]',
			bodyclass   = 'hlist',
			list1       = table.concat( elements, ' • ' )
			} )
end

return p