Difference between revisions of "Module:Entity"

From Wikibase.slis.ua.edu
Jump to navigation Jump to search
Line 10: Line 10:
 
function p.getSiteLink ( frame )
 
function p.getSiteLink ( frame )
 
     return mw.wikibase.getSitelink(mw.wikibase.getEntityIdForTitle(frame.args[0]))
 
     return mw.wikibase.getSitelink(mw.wikibase.getEntityIdForTitle(frame.args[0]))
 +
end
 +
function p.getPriorPlay ( frame )
 +
    return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P40' ).value
 +
end
 +
function p.getNextPlay ( frame )
 +
    return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P41' ).value
 
end
 
end
 
return p
 
return p

Revision as of 00:20, 15 April 2019

Documentation for this module may be created at Module:Entity/doc

local p = {} -- p stands for package

function p.get( frame )
     return mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)
end

function p.getUrl ( frame )
     return mw.wikibase.getEntityUrl(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text))
end
function p.getSiteLink ( frame )
     return mw.wikibase.getSitelink(mw.wikibase.getEntityIdForTitle(frame.args[0]))
end
function p.getPriorPlay ( frame )
     return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P40' ).value
end
function p.getNextPlay ( frame )
     return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P41' ).value
end
return p