<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://naturalphilosophy.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AEditAtWikidata</id>
	<title>Module:EditAtWikidata - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://naturalphilosophy.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AEditAtWikidata"/>
	<link rel="alternate" type="text/html" href="http://naturalphilosophy.org/wiki/index.php?title=Module:EditAtWikidata&amp;action=history"/>
	<updated>2026-04-09T22:42:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://naturalphilosophy.org/wiki/index.php?title=Module:EditAtWikidata&amp;diff=29462&amp;oldid=prev</id>
		<title>NickPercival: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://naturalphilosophy.org/wiki/index.php?title=Module:EditAtWikidata&amp;diff=29462&amp;oldid=prev"/>
		<updated>2017-07-19T22:05:45Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Module to display an icon with a tooltip such as &amp;quot;Edit this at Wikidata&amp;quot;&lt;br /&gt;
-- Icon will be linked to the Wikidata entry for the article where this is placed.&lt;br /&gt;
-- This message is only displayed if a local_parameter is not supplied&lt;br /&gt;
-- i.e. when called from a template, it can be coded not to display the message &lt;br /&gt;
-- when a local parameter is in use, preventing the value form Wikidata being fetched.&lt;br /&gt;
-- The qid of a Wikidata entry can optionally be supplied for testing outside the article.&lt;br /&gt;
-- Usage:&lt;br /&gt;
-- {{#invoke:EditAtWikidata|showMessage|local_parameter}}&lt;br /&gt;
-- {{#invoke:EditAtWikidata|showMessage|qid=&amp;lt;ArticleID|local_parameter}}&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local i18n =&lt;br /&gt;
{&lt;br /&gt;
    [&amp;quot;message&amp;quot;] = &amp;quot;Edit this at Wikidata&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
p.showMessage = function(frame)&lt;br /&gt;
	&lt;br /&gt;
	-- There may be a local parameter supplied, if it&amp;#039;s blank, set it to nil&lt;br /&gt;
	local local_parm =  mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	if local_parm and (#local_parm == 0) then local_parm = nil end&lt;br /&gt;
	&lt;br /&gt;
	-- If there is a local parameter used, we don&amp;#039;t want to display the message&lt;br /&gt;
	if local_parm then return nil end&lt;br /&gt;
	&lt;br /&gt;
	-- Can take a named parameter |qid which is the Wikidata ID for the article.&lt;br /&gt;
	-- This will not normally be used except for testing outside the article.&lt;br /&gt;
	local qid = frame.args.qid&lt;br /&gt;
	if qid and (#qid == 0) then qid = nil end&lt;br /&gt;
	&lt;br /&gt;
	-- The module can take a parameter pid= &lt;br /&gt;
	-- which will create a link to that property in the Wikidata entry for the article&lt;br /&gt;
	local propertyID = mw.text.trim(frame.args.pid or &amp;quot;&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- Get the object containing all the claims for the article&lt;br /&gt;
	local entity = mw.wikibase.getEntityObject(qid)&lt;br /&gt;
	if entity then&lt;br /&gt;
		local thisQid&lt;br /&gt;
		if qid then thisQid = qid else thisQid = entity.id end&lt;br /&gt;
		&lt;br /&gt;
		local icon&lt;br /&gt;
		if propertyID then&lt;br /&gt;
			icon = &amp;quot; [[File:Blue pencil.svg |frameless |text-top |10px |alt=&amp;quot; .. i18n.message .. &amp;quot; |link=https://www.wikidata.org/wiki/&amp;quot; .. thisQid .. &amp;quot;#&amp;quot; .. propertyID .. &amp;quot;|&amp;quot; .. i18n.message .. &amp;quot;]]&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			icon = &amp;quot; [[File:Blue pencil.svg |frameless |text-top |10px |alt=&amp;quot; .. i18n.message .. &amp;quot; |link=https://www.wikidata.org/wiki/&amp;quot; .. thisQid .. &amp;quot;|&amp;quot; .. i18n.message .. &amp;quot;]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		return icon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>NickPercival</name></author>
	</entry>
</feed>