Difference between revisions of "Module:Authority control files"

From blackwiki
Jump to navigation Jump to search
blackwiki>Tom.Reding
m (--better)
blackwiki>Jay D. Easy
Line 26: Line 26:
 
title      = '[[Authority control|Authority control files]]',
 
title      = '[[Authority control|Authority control files]]',
 
bodyclass  = 'hlist',
 
bodyclass  = 'hlist',
 +
state      = 'collapsed',
 
list1      = table.concat( elements, ' • ' )
 
list1      = table.concat( elements, ' • ' )
 
} )
 
} )

Revision as of 11:41, 13 October 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'] = 'redundant [[MusicBrainz]] link',
		['MBI'] = 'redundant [[MusicBrainz]] link',
		['MBL'] = 'redundant [[MusicBrainz]] link',	
		['MBP'] = 'redundant [[MusicBrainz]] link',	
		['MBRG'] = 'redundant [[MusicBrainz]] link',
		['MBS'] = 'redundant [[MusicBrainz]] link',
		['MBW'] = 'redundant [[MusicBrainz]] link',
	}
	
	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',
			state       = 'collapsed',
			list1       = table.concat( elements, ' • ' )
			} )
end

return p