This Lua module is used on many 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 is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
localp={}localgetArgsfunctionp._navbar(args)localtitleArg=1ifargs.collapsiblethentitleArg=2ifnotargs.plainthenargs.mini=1endifargs.fontcolorthenargs.fontstyle='color:'..args.fontcolor..';'endargs.style='float:left; text-align:left; width:6em;'endlocaltitleText=args[titleArg]or(':'..mw.getCurrentFrame():getParent():getTitle())localtitle=mw.title.new(mw.text.trim(titleText),'Template');ifnottitlethenerror('Invalid title '..titleText)endlocaltalkpage=title.talkPageTitleandtitle.talkPageTitle.fullTextor'';localdiv=mw.html.create():tag('div')div:addClass('plainlinks'):addClass('hlist'):addClass('navbar'):cssText(args.style)ifargs.minithendiv:addClass('mini')endifnot(args.miniorargs.plain)thendiv:tag('span'):css('word-spacing',0):cssText(args.fontstyle):wikitext(args.textor'This box:'):wikitext(' ')endifargs.bracketsthendiv:tag('span'):css('margin-right','-0.125em'):cssText(args.fontstyle):wikitext('['):newline();endlocalul=div:tag('ul');ul:tag('li'):addClass('nv-view'):wikitext('[['..title.fullText..'|'):tag(args.miniand'abbr'or'span'):attr('title','View this template'):cssText(args.fontstyle):wikitext(args.miniand'v'or'view'):done():wikitext(']]'):done():tag('li'):addClass('nv-talk'):wikitext('[['..talkpage..'|'):tag(args.miniand'abbr'or'span'):attr('title','Discuss this template'):cssText(args.fontstyle):wikitext(args.miniand't'or'talk'):done():wikitext(']]');ifnotargs.noeditthenul:tag('li'):addClass('nv-edit'):wikitext('['..title:fullUrl('action=edit')..' '):tag(args.miniand'abbr'or'span'):attr('title','Edit this template'):cssText(args.fontstyle):wikitext(args.miniand'e'or'edit'):done():wikitext(']');endifargs.bracketsthendiv:tag('span'):css('margin-left','-0.125em'):cssText(args.fontstyle):wikitext(']'):newline();endifargs.collapsiblethendiv:done():tag('span'):css('font-size','110%'):cssText(args.fontstyle):wikitext(args[1])endreturntostring(div:done())endfunctionp.navbar(frame)ifnotgetArgsthengetArgs=require('Module:Arguments').getArgsendreturnp._navbar(getArgs(frame))endreturnp