Module:Navboxes/sandbox
Appearance
From Wikipedia, the free encyclopedia
A request that this page title be changed to Module:Navbox group is under discussion . Please do not move this page until the discussion is closed.
Warning This Lua module is used on approximately 65,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:
Implements most of {{Navboxes }}.
The above documentation is transcluded from Module:Navboxes/doc. (edit | history)
Editors can experiment in this module's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
Editors can experiment in this module's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
-- This implements Template:navboxes localp={} localgetArgs=require('Module:Arguments').getArgs localNavbox=require('Module:Navbox') localfunctionisnotempty(s) returnsands:match('^%s*(.-)%s*$')~='' end localfunctionnavboxes(args,list) localnavbar=(args['state']andargs['state']=='off')and'off'or'plain' localtitle=args['title']or'Links to related articles' localtitlestyle='background:'..(args['bg']or'#e8e8ff')..';' ..(isnotempty(args['fg'])and('color:'..args['fg']..';')or'color:inherit;') ..(isnotempty(args['bordercolor'])and('border: 1px solid '..args['bordercolor']..';')or'') ..(args['titlestyle']or'') returnNavbox._navbox({ navbar=navbar,title=title, list1=list, state=args['state']or'collapsed', titlestyle=titlestyle, liststyle='font-size:114%', listpadding='0px', tracking='no' }) end functionp.top(frame) localargs=getArgs(frame) localparts=mw.text.split(navboxes(args,'<ADD LIST HERE>'),'<ADD LIST HERE>') returnparts[1] end functionp.bottom(frame) localargs={} localparts=mw.text.split(navboxes(args,'<ADD LIST HERE>'),'<ADD LIST HERE>') returnparts[2] end functionp.navbox(frame) localargs=getArgs(frame) locallist=args['list1']orargs['list']or'' localtrack_cats='' iflist==''then ifmw.title.getCurrentTitle().namespace==0then track_cats='[[Category:Navboxes template with no content]]' end end returnnavboxes(args,list)..track_cats end returnp