<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://belgen.info/wiki/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3AUniversal_infocard</id>
	<title>Модуль:Universal infocard - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://belgen.info/wiki/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3AUniversal_infocard"/>
	<link rel="alternate" type="text/html" href="https://belgen.info/wiki/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Universal_infocard&amp;action=history"/>
	<updated>2026-04-25T19:03:15Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://belgen.info/wiki/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Universal_infocard&amp;diff=855&amp;oldid=prev</id>
		<title>Admin: Новая страница: «--   Lua code for universal infocard.   local isConfig, config = pcall( require, 'Module:Universal infocard/config' ); if isConfig == false then 	config = { 		skipPropertyIds = { 			P31 = true, 			P279 = true, 		} 	}; end  local p = {}; local lang = mw.getContentLanguage(); local entityId = nil;  -- CSS classes. local classes = {}; if config and config.classes then 	for key, value in pairs( config.classes ) do 		classes[ key ] = value; 	end end 	 functio...»</title>
		<link rel="alternate" type="text/html" href="https://belgen.info/wiki/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Universal_infocard&amp;diff=855&amp;oldid=prev"/>
		<updated>2022-12-20T23:51:21Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: «--&lt;a href=&quot;/wiki/index.php?title=Lua_code_for_universal_infocard.&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Lua code for universal infocard. (страница не существует)&quot;&gt;Lua code for universal infocard. &lt;/a&gt;  local isConfig, config = pcall( require, &amp;#039;Module:Universal infocard/config&amp;#039; ); if isConfig == false then 	config = { 		skipPropertyIds = { 			P31 = true, 			P279 = true, 		} 	}; end  local p = {}; local lang = mw.getContentLanguage(); local entityId = nil;  -- CSS classes. local classes = {}; if config and config.classes then 	for key, value in pairs( config.classes ) do 		classes[ key ] = value; 	end end 	 functio...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
  Lua code for universal infocard.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local isConfig, config = pcall( require, 'Module:Universal infocard/config' );&lt;br /&gt;
if isConfig == false then&lt;br /&gt;
	config = {&lt;br /&gt;
		skipPropertyIds = {&lt;br /&gt;
			P31 = true,&lt;br /&gt;
			P279 = true,&lt;br /&gt;
		}&lt;br /&gt;
	};&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local p = {};&lt;br /&gt;
local lang = mw.getContentLanguage();&lt;br /&gt;
local entityId = nil;&lt;br /&gt;
&lt;br /&gt;
-- CSS classes.&lt;br /&gt;
local classes = {};&lt;br /&gt;
if config and config.classes then&lt;br /&gt;
	for key, value in pairs( config.classes ) do&lt;br /&gt;
		classes[ key ] = value;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function getClassString( type )&lt;br /&gt;
	local class;&lt;br /&gt;
	if classes[type] then&lt;br /&gt;
		class = classes[type];&lt;br /&gt;
	elseif type ~= '' then&lt;br /&gt;
		class = 'infobox-' .. type;&lt;br /&gt;
	else&lt;br /&gt;
		class = 'infobox';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if class == '' then&lt;br /&gt;
		return '';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ' class=&amp;quot;'.. class .. '&amp;quot;';&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function getTemplate( propertyId )&lt;br /&gt;
	if config and config.templates and config.templates[ propertyId ] then&lt;br /&gt;
		return config.templates[ propertyId ];&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if propertyId == 'title' then&lt;br /&gt;
		return '{{PAGENAME}}';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if propertyId == 'map' then&lt;br /&gt;
		return getMap;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if config and config.templates and config.templates.default then&lt;br /&gt;
		return config.templates.default;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if string.match( propertyId, '^P%d+$' ) then&lt;br /&gt;
		return '#statements:' .. propertyId;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return nil;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function expandTemplate( frame, title, args )&lt;br /&gt;
	if not title then&lt;br /&gt;
		return '';&lt;br /&gt;
	elseif type( title ) == 'function' then&lt;br /&gt;
		args.frame = frame;&lt;br /&gt;
		return title( args )&lt;br /&gt;
	elseif type( title ) == 'string' then&lt;br /&gt;
		if string.match( title, '^#' ) then&lt;br /&gt;
			return frame:callParserFunction{ name = title, args = args };&lt;br /&gt;
		elseif string.match( title, '^{' ) then&lt;br /&gt;
			return frame:preprocess( title );&lt;br /&gt;
		else&lt;br /&gt;
			return frame:expandTemplate{ title = title, args = args };&lt;br /&gt;
		end&lt;br /&gt;
	elseif type( title ) == 'table' then&lt;br /&gt;
		local realTitle = title[ 1 ];&lt;br /&gt;
		table.remove( title, 1 )&lt;br /&gt;
		return expandTemplate( frame, realTitle, title )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function splitLine( value1, value2 )&lt;br /&gt;
	local result = '';&lt;br /&gt;
	if ( value1 and string.len( value1 ) ~= 0 ) or ( value2 and string.len( value2 ) ~= 0 ) then&lt;br /&gt;
		result = '&amp;lt;tr&amp;gt;';&lt;br /&gt;
		if ( value1 and string.len( value1 ) ~= 0 ) then&lt;br /&gt;
			local colspan = '';&lt;br /&gt;
			if ( not value2 or string.len( value2 ) == 0 ) then&lt;br /&gt;
				colspan = 'colspan=&amp;quot;2&amp;quot;';&lt;br /&gt;
			end&lt;br /&gt;
			result = result .. '&amp;lt;td ' .. colspan .. getClassString( 'split' ) .. '&amp;gt;';&lt;br /&gt;
			result = result .. value1;&lt;br /&gt;
			result = result .. '&amp;lt;/td&amp;gt;';&lt;br /&gt;
		end&lt;br /&gt;
		if ( value2 and string.len( value2 ) ~= 0 ) then&lt;br /&gt;
			local colspan = '';&lt;br /&gt;
			if ( not value1 or string.len( value1 ) == 0 ) then&lt;br /&gt;
				colspan = 'colspan=&amp;quot;2&amp;quot;';&lt;br /&gt;
			end&lt;br /&gt;
			result = result .. '&amp;lt;td ' .. colspan .. getClassString( 'split' ) .. '&amp;gt;';&lt;br /&gt;
			result = result .. value2;&lt;br /&gt;
			result = result .. '&amp;lt;/td&amp;gt;';&lt;br /&gt;
		end&lt;br /&gt;
		result = result .. '&amp;lt;/tr&amp;gt;\n';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getLine( value, class, header )&lt;br /&gt;
	local result = '';&lt;br /&gt;
	local tag = header and 'th scope=&amp;quot;colgroup&amp;quot;' or 'td';&lt;br /&gt;
	if ( value and string.len( value ) ~= 0 ) then&lt;br /&gt;
		result = result .. '&amp;lt;tr&amp;gt;&amp;lt;' .. tag .. ' colspan=&amp;quot;2&amp;quot;'.. getClassString( class ) .. '&amp;gt;';&lt;br /&gt;
		result = result .. value;&lt;br /&gt;
		result = result .. '&amp;lt;/' .. tag .. '&amp;gt;&amp;lt;/tr&amp;gt;\n';&lt;br /&gt;
		return result;&lt;br /&gt;
	end&lt;br /&gt;
	return result;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getValue( label, value )&lt;br /&gt;
	local result = '';&lt;br /&gt;
	if ( value ~= nil and string.len( value ) ~= 0 ) then&lt;br /&gt;
		if label then&lt;br /&gt;
			result = result .. '&amp;lt;tr&amp;gt;&amp;lt;th scope=&amp;quot;row&amp;quot;' .. getClassString( 'label' ) .. '&amp;gt;' .. label .. '&amp;lt;/th&amp;gt;';&lt;br /&gt;
			result = result .. '&amp;lt;td' .. getClassString( 'text' ) .. '&amp;gt;\n';&lt;br /&gt;
		else&lt;br /&gt;
			result = result .. '&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot;' .. getClassString( 'text' ) .. '&amp;gt;';&lt;br /&gt;
		end&lt;br /&gt;
		result = result .. value;&lt;br /&gt;
		result = result .. '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n';&lt;br /&gt;
		return result;&lt;br /&gt;
	end&lt;br /&gt;
	return result;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getMap( args )&lt;br /&gt;
	local entityId = args.entityId or mw.wikibase.getEntityIdForCurrentPage();&lt;br /&gt;
	local statements = mw.wikibase.getBestStatements( entityId, 'P625' );&lt;br /&gt;
	&lt;br /&gt;
	if not statements or&lt;br /&gt;
		not statements[ 1 ] or&lt;br /&gt;
		not statements[ 1 ].mainsnak or&lt;br /&gt;
		statements[ 1 ].mainsnak.snaktype ~= 'value' or&lt;br /&gt;
		statements[ 1 ].mainsnak.datavalue.value.globe ~= 'http://www.wikidata.org/entity/Q2'&lt;br /&gt;
	then&lt;br /&gt;
		return '';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local coord = statements[ 1 ].mainsnak.datavalue.value;&lt;br /&gt;
	local title = expandTemplate( args.frame, getTemplate( 'title' ), { from = entityId } );&lt;br /&gt;
&lt;br /&gt;
	local mapContent = [[ {&lt;br /&gt;
		&amp;quot;type&amp;quot;: &amp;quot;Feature&amp;quot;,&lt;br /&gt;
		&amp;quot;geometry&amp;quot;: {&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;Point&amp;quot;,&lt;br /&gt;
			&amp;quot;coordinates&amp;quot;: [&lt;br /&gt;
				]] .. coord['longitude'] .. [[,&lt;br /&gt;
				]] .. coord['latitude'] .. [[&lt;br /&gt;
			]&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;properties&amp;quot;: {&lt;br /&gt;
			&amp;quot;title&amp;quot;: &amp;quot;]] .. title .. [[&amp;quot;,&lt;br /&gt;
			&amp;quot;marker-symbol&amp;quot;: &amp;quot;star&amp;quot;,&lt;br /&gt;
			&amp;quot;marker-color&amp;quot;: &amp;quot;#3366cc&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
    }, {&lt;br /&gt;
		&amp;quot;type&amp;quot;: &amp;quot;ExternalData&amp;quot;,&lt;br /&gt;
		&amp;quot;service&amp;quot;: &amp;quot;geoline&amp;quot;,&lt;br /&gt;
		&amp;quot;ids&amp;quot;: &amp;quot;]] .. entityId .. [[&amp;quot;,&lt;br /&gt;
		&amp;quot;properties&amp;quot;: {&lt;br /&gt;
			&amp;quot;stroke&amp;quot;: &amp;quot;#FF9999&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
    }, {&lt;br /&gt;
		&amp;quot;type&amp;quot;: &amp;quot;ExternalData&amp;quot;,&lt;br /&gt;
		&amp;quot;service&amp;quot;: &amp;quot;geoshape&amp;quot;,&lt;br /&gt;
		&amp;quot;ids&amp;quot;: &amp;quot;]] .. entityId .. [[&amp;quot;,&lt;br /&gt;
		&amp;quot;properties&amp;quot;: {&lt;br /&gt;
			&amp;quot;fill&amp;quot;: &amp;quot;#FF0000&amp;quot;,&lt;br /&gt;
			&amp;quot;fill-opacity&amp;quot;: 0.1,&lt;br /&gt;
			&amp;quot;stroke&amp;quot;: &amp;quot;#FF9999&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	} ]];&lt;br /&gt;
&lt;br /&gt;
    return args.frame:extensionTag{&lt;br /&gt;
    	name = 'mapframe',&lt;br /&gt;
    	content = '[' .. mapContent .. ']',&lt;br /&gt;
    	args = {&lt;br /&gt;
			'frameless',&lt;br /&gt;
			align = 'center',&lt;br /&gt;
			latitude = coord['latitude'],&lt;br /&gt;
			longitude = coord['longitude'],&lt;br /&gt;
			zoom = 11,&lt;br /&gt;
			width = 300,&lt;br /&gt;
			height = 250,&lt;br /&gt;
		}&lt;br /&gt;
	};&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function renderValue( frame, propertyId, args )&lt;br /&gt;
	local tplArgs = { propertyId, from = entityId, entityId = entityId, nocat = frame.args['nocat'] };&lt;br /&gt;
&lt;br /&gt;
	if args then&lt;br /&gt;
	    local k = nil;&lt;br /&gt;
	    repeat&lt;br /&gt;
	        k = next( args, k );&lt;br /&gt;
	        if k then&lt;br /&gt;
	            tplArgs[ k ] = args[ k ];&lt;br /&gt;
	        end&lt;br /&gt;
	    until not k&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return expandTemplate( frame, getTemplate( propertyId ), tplArgs );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Filter deprecated claims and returning only preferred ones if present.&lt;br /&gt;
function filterClaims( entity, propertyId )&lt;br /&gt;
	if ( entity.claims == nil or entity.claims[ propertyId ] == nil ) then&lt;br /&gt;
		return {};&lt;br /&gt;
	end&lt;br /&gt;
	local all = entity.claims[ propertyId ];&lt;br /&gt;
	local normal = {};&lt;br /&gt;
	local preferred = {};&lt;br /&gt;
	for _, claim in pairs( all ) do&lt;br /&gt;
		local rank = claim.rank or 'normal';&lt;br /&gt;
		if ( rank == 'normal' ) then&lt;br /&gt;
			table.insert( normal, claim );&lt;br /&gt;
		end&lt;br /&gt;
		if ( rank == 'preferred' ) then&lt;br /&gt;
			table.insert( preferred, claim );&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if ( #preferred &amp;gt; 0 ) then&lt;br /&gt;
		return preferred;&lt;br /&gt;
	end&lt;br /&gt;
	return normal;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Filter deprecated claims and returning only preferred ones if present.&lt;br /&gt;
function propertyHasEntity( claims, itemId )&lt;br /&gt;
	if not claims then&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
	for _, claim in pairs( claims ) do&lt;br /&gt;
		if claim.mainsnak&lt;br /&gt;
			and claim.mainsnak.datavalue&lt;br /&gt;
			and claim.mainsnak.datavalue.value&lt;br /&gt;
			and claim.mainsnak.datavalue.value.id&lt;br /&gt;
			and claim.mainsnak.datavalue.value.id == itemId then&lt;br /&gt;
				return true;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function propertyLabel( propertyId )&lt;br /&gt;
	local label, labelLang = mw.wikibase.getLabelWithLang( propertyId );&lt;br /&gt;
	label = lang:ucfirst( label );&lt;br /&gt;
	if labelLang ~= lang:getCode() then&lt;br /&gt;
		label = '[[d:Property:' .. propertyId .. '|' .. label .. ']]';&lt;br /&gt;
	end&lt;br /&gt;
	return label;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function simpleLabel( entityId )&lt;br /&gt;
	local label = mw.wikibase.label( entityId );&lt;br /&gt;
	label = lang:ucfirst( label );&lt;br /&gt;
	return label;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getErrorMessage( message )&lt;br /&gt;
	local result = '&amp;lt;table' .. getClassString( 'error' ) .. '&amp;gt;\n';&lt;br /&gt;
	result = result .. '&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;' .. message .. '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n';&lt;br /&gt;
	result = result .. '&amp;lt;/table&amp;gt;';&lt;br /&gt;
	return result;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.render( frame )&lt;br /&gt;
	local i18n_error_emptyWikidataEntity = '';&lt;br /&gt;
	local i18n_error_noWikidataEntity = '';&lt;br /&gt;
	if config and config.i18n and config.i18n.error then&lt;br /&gt;
		if config.i18n.error.emptyWikidataEntity then&lt;br /&gt;
			i18n_error_emptyWikidataEntity = config.i18n.error.emptyWikidataEntity;&lt;br /&gt;
		end&lt;br /&gt;
		if config.i18n.error.noWikidataEntity then&lt;br /&gt;
			i18n_error_noWikidataEntity = config.i18n.error.noWikidataEntity;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local result = '&amp;lt;table' .. getClassString( '' );&lt;br /&gt;
	if config and config.i18n and config.i18n.dataName then&lt;br /&gt;
		result = result .. ' data-name=&amp;quot;' .. config.i18n.dataName .. '&amp;quot;';&lt;br /&gt;
	end&lt;br /&gt;
	result = result .. '&amp;gt;\n';&lt;br /&gt;
&lt;br /&gt;
	local localImage = nil;&lt;br /&gt;
&lt;br /&gt;
	if ( frame ~= nil and frame:getParent() ~= nil ) then&lt;br /&gt;
		local p_frame = frame:getParent();&lt;br /&gt;
		if p_frame.args ~= nil then&lt;br /&gt;
			-- image under FU only in local&lt;br /&gt;
			localImage = p_frame.args.image;&lt;br /&gt;
		&lt;br /&gt;
			if p_frame.args.from ~= nil and p_frame.args.from ~= '' then&lt;br /&gt;
				entityId = p_frame.args.from;&lt;br /&gt;
			elseif p_frame.args[ 1 ] ~= nil and string.gmatch( p_frame.args[ 1 ], '^Q\d+$' ) then&lt;br /&gt;
				entityId = p_frame.args[ 1 ];&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local wdStatus, entity = pcall( mw.wikibase.getEntity, entityId );&lt;br /&gt;
	if wdStatus ~= true or entity == nil then&lt;br /&gt;
		return getErrorMessage( i18n_error_noWikidataEntity );&lt;br /&gt;
	elseif entity.claims == nil then&lt;br /&gt;
		return getErrorMessage( i18n_error_emptyWikidataEntity );&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- TODO: Need to consider how to display class properties (P31, P279, P361, ...).&lt;br /&gt;
	local skipPropertyIds = {};&lt;br /&gt;
	if config.skipPropertyIds then&lt;br /&gt;
		skipPropertyIds = mw.clone( config.skipPropertyIds );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local claims = entity.claims;&lt;br /&gt;
	local order = mw.wikibase.getPropertyOrder() or {};&lt;br /&gt;
&lt;br /&gt;
	-- Header.&lt;br /&gt;
	local entityLabel, entityLabelLang  = entity:getLabelWithLang( lang:getCode() );&lt;br /&gt;
	local label;&lt;br /&gt;
&lt;br /&gt;
	---- Name.&lt;br /&gt;
	local titleTemplate = getTemplate( 'title' );&lt;br /&gt;
	-- TODO: Make it possible to specify a template for any value, not just Q5.&lt;br /&gt;
	if propertyHasEntity( claims.P31, 'Q5' ) then&lt;br /&gt;
		local titleTemplateQ5 = getTemplate( 'title_Q5' );&lt;br /&gt;
		if titleTemplateQ5 then&lt;br /&gt;
			titleTemplate = titleTemplateQ5;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if entityLabelLang == lang:getCode() then&lt;br /&gt;
		label = expandTemplate( frame, titleTemplate, { wdLabel, from = entityId } );&lt;br /&gt;
	else&lt;br /&gt;
		label = expandTemplate( frame, titleTemplate, { from = entityId } );&lt;br /&gt;
	end&lt;br /&gt;
	result = result .. getLine( label, 'above', true );&lt;br /&gt;
&lt;br /&gt;
	---- Original name.&lt;br /&gt;
	if claims.P1559 ~= nil then&lt;br /&gt;
		result = result .. getLine( expandTemplate( frame, getTemplate( 'P1559' ), { from = entityId } ), 'original' );&lt;br /&gt;
	elseif claims.P1705 ~= nil then&lt;br /&gt;
		result = result .. getLine( expandTemplate( frame, getTemplate( 'P1705' ), { from = entityId } ), 'original' );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	---- Flag and COA.&lt;br /&gt;
	if claims.P41 or claims.P94 then&lt;br /&gt;
		local flag = nil;&lt;br /&gt;
		local flagLabel = nil;&lt;br /&gt;
		local coa = nil;&lt;br /&gt;
		local coaLabel = nil;&lt;br /&gt;
&lt;br /&gt;
		if claims.P41 then&lt;br /&gt;
			flag = renderValue( frame, 'P41' );&lt;br /&gt;
			if claims.P163 then&lt;br /&gt;
				flagLabel = renderValue( frame, 'P163', { text = simpleLabel( 'Q14660' ) } );&lt;br /&gt;
			else&lt;br /&gt;
				flagLabel = simpleLabel( 'Q14660' );&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if claims.P94 then&lt;br /&gt;
			coa = renderValue( frame, 'P94' );&lt;br /&gt;
			if claims.P163 then&lt;br /&gt;
				coaLabel = renderValue( frame, 'P237', { text = simpleLabel( 'Q14659' ) } );&lt;br /&gt;
			else&lt;br /&gt;
				coaLabel = simpleLabel( 'Q14659' );&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		result = result .. splitLine( flagLabel, coaLabel );&lt;br /&gt;
		result = result .. splitLine( flag, coa );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Body.&lt;br /&gt;
	local propertyIds = {};&lt;br /&gt;
	for propertyId, claim in pairs( entity.claims ) do&lt;br /&gt;
		table.insert( propertyIds, propertyId );&lt;br /&gt;
	end&lt;br /&gt;
	local orderedProperties = mw.wikibase.orderProperties( propertyIds )&lt;br /&gt;
	&lt;br /&gt;
	local shownProperties = 0&lt;br /&gt;
	for i, propertyId in ipairs( orderedProperties ) do&lt;br /&gt;
		local propertyClaims = claims[ propertyId ];&lt;br /&gt;
		if not skipPropertyIds[ propertyId ]&lt;br /&gt;
				and propertyClaims&lt;br /&gt;
				and propertyClaims[ 1 ]&lt;br /&gt;
				and propertyClaims[ 1 ].mainsnak&lt;br /&gt;
				and propertyClaims[ 1 ].mainsnak.datatype&lt;br /&gt;
				and propertyClaims[ 1 ].mainsnak.datatype ~= 'external-id'&lt;br /&gt;
				and propertyClaims[ 1 ].mainsnak.datatype ~= 'tabular-data'&lt;br /&gt;
				and propertyClaims[ 1 ].mainsnak.datatype ~= 'wikibase-property'&lt;br /&gt;
		then&lt;br /&gt;
			local label = propertyLabel( propertyId );&lt;br /&gt;
			if propertyClaims[ 1 ].mainsnak.datatype == 'commonsMedia' then&lt;br /&gt;
				result = result .. getLine( renderValue( frame, propertyId, { alt = label } ), 'image' );&lt;br /&gt;
			else&lt;br /&gt;
				result = result .. getValue( label, renderValue( frame, propertyId ) );&lt;br /&gt;
			end&lt;br /&gt;
			skipPropertyIds[ propertyId ] = true&lt;br /&gt;
			shownProperties = shownProperties + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Footer.&lt;br /&gt;
&lt;br /&gt;
	---- Map.&lt;br /&gt;
	if claims.P625 ~= nil then&lt;br /&gt;
		result = result .. getLine( renderValue( frame, 'map' ), 'text' );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	---- Commons.&lt;br /&gt;
	if claims.P373 ~= nil then&lt;br /&gt;
		result = result .. getLine( expandTemplate( frame, getTemplate( 'P373' ), { from = entityId } ), 'below' );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	result = result .. '&amp;lt;/table&amp;gt;';&lt;br /&gt;
&lt;br /&gt;
	-- Coords.&lt;br /&gt;
	if claims.P625 ~= nil then&lt;br /&gt;
		result = result .. renderValue( frame, 'P625', { display = 'title' } );&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Tracking category.&lt;br /&gt;
	if config and config.categories and config.categories['few-properties-shown'] then&lt;br /&gt;
		if shownProperties &amp;lt; 4 then&lt;br /&gt;
			result = result .. '[[Category:' .. config.categories['few-properties-shown'] .. '|' .. shownProperties .. ']]'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>