Module:Listbox: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
use Args.fromFrame which also pulls from the parent frame
mNo edit summary
(use Args.fromFrame which also pulls from the parent frame)
Line 1: Line 1:
local Args = require( 'Module:Args' )
local Box = require( 'Module:Box' ).Box
local Box = require( 'Module:Box' ).Box
local Lazy = require( 'Module:Lazy' ) -- may load: Tabs, Gallery, Args
local Lazy = require( 'Module:Lazy' ) -- may load: Tabs, Gallery


function getCategoryProps( categoryName )
function getCategoryProps( categoryName )
Line 28: Line 29:
     if getPageProps then
     if getPageProps then
       local pageContent = mw.title.new( page.text ):getContent()
       local pageContent = mw.title.new( page.text ):getContent()
       page.args = Lazy.load( 'Module:Args' ).fromPageContent( pageContent, 'Cat%s*|%s*' .. categoryName )
       page.args = Args.fromPageContent( pageContent, 'Cat%s*|%s*' .. categoryName )
     else
     else
       page.args = {}
       page.args = {}
Line 180: Line 181:
function mt.__index( table, key )
function mt.__index( table, key )
   return function ( frame )
   return function ( frame )
     return table._main( key, frame.args )
     return table._main( key, Args.fromFrame( frame ) )
   end
   end
end
end

Navigation menu