Difference between revisions of "Module:Entity"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
function p.getPriorPlay ( frame ) | function p.getPriorPlay ( frame ) | ||
-- return mw.wikibase.getEntityIdForTitle(mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P40' ).value) | -- return mw.wikibase.getEntityIdForTitle(mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P40' ).value) | ||
− | return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):getBestStatements( ' | + | return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):getBestStatements( 'P40' )[1].mainsnak.datavalue.value['id'] |
end | end | ||
function p.getNextPlay ( frame ) | function p.getNextPlay ( frame ) |
Revision as of 00:52, 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.getEntityIdForTitle(mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P40' ).value) return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):getBestStatements( 'P40' )[1].mainsnak.datavalue.value['id'] end function p.getNextPlay ( frame ) -- return mw.wikibase.getEntityIdForTitle(mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):formatPropertyValues( 'P41' ).value) return mw.wikibase.getEntity(mw.wikibase.getEntityIdForTitle(mw.title.getCurrentTitle().text)):getBestStatements( 'P41' )[1].mainsnak.datavalue.value['id'] end return p