Module:Navbox top and bottom
Appearance
From Wikipedia, the free encyclopedia
Warning This Lua module is used on approximately 17,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.
This module depends on the following other modules:
Usage
{{#invoke:Navbox top and bottom|function_name}}
The above documentation is transcluded from Module:Navbox top and bottom/doc. (edit | history)
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Subpages of this module.
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Subpages of this module.
-- This implements {{navbox top}} and {{navbox bottom}} localp={} localfunctionbuild_navbox(parentArgs,list) localargs={} forargName,valueinpairs(parentArgs)do ifvalue~=''then iftype(argName)=='string'then args[argName]=value end end end args['bodystyle']='display:table;'..(args['bodystyle']or'') args['list1padding']='0' args['list1style']='border-width:0;' args['list1']=list -- Note Navbox.navbox() has a kludge to order the parent frame's args -- into a specific order. For now, this is omitted from this module. localNavbox=require('Module:Navbox') returnNavbox._navbox(args) end functionp.top(frame) localargs=frame:getParent().args localparts=mw.text.split(build_navbox(args,'<ADD LIST HERE>'),'<ADD LIST HERE>') returnparts[1] end functionp.bottom(frame) localargs=frame:getParent().args localparts=mw.text.split(build_navbox(args,'<ADD LIST HERE>'),'<ADD LIST HERE>') returnparts[2] end returnp