Topic on Project:Support desk

Navbox not working 100%

11
Kentsmith9 (talkcontribs)

I am working on a Wiki and trying to get the Navbox operating. I am very close example navbox

Most of the navbox displays correctly (show/hide, odd/even striping, table heading colors), except my lists are vertical. Also my groups headings are not picking up the table heading background color like it does in the Wikipedia navbox.

Installed SW

  • MediaWiki: 1.22.2
  • PHP: 5.3.10-1ubuntu3.12 (cgi-fcgi)
  • MySQL: 5.5.37-0ubuntu0.12.04.1-log
  • ParserFunctions: 1.5.1

Parser function hooks: anchorencode, babel, basepagename, basepagenamee, canonicalurl, canonicalurle, count, defaultsort, displaytitle, ev, evp, explode, expr, filepath, formatdate, formatnum, fullpagename, fullpagenamee, fullurl, fullurle, gender, grammar, if, ifeq, iferror, ifexist, ifexpr, int, language, lc, lcfirst, len, localurl, localurle, namespace, namespacee, namespacenumber, ns, nse, numberingroup, numberofactiveusers, numberofadmins, numberofarticles, numberofedits, numberoffiles, numberofpages, numberofusers, numberofviews, padleft, padright, pagename, pagenamee, pagesincategory, pagesize, plural, pos, protectionlevel, rel2abs, replace, rootpagename, rootpagenamee, rpos, special, speciale, sub, subjectpagename, subjectpagenamee, subjectspace, subjectspacee, subpagename, subpagenamee, switch, tag, talkpagename, talkpagenamee, talkspace, talkspacee, time, timel, titleparts, uc, ucfirst, urldecode and urlencode

We don't have Lua or Tidy installed, so I used the version recommended at http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Transwiki/Template:Navbox (and the {navbar} over there as well). I don't have server side access, but I did copy the CSS (MediaWiki:Common.css) and script (MediaWiki:Common.js). I tried the ones from MediaWiki first then Wikipedia (not sure if they were the same), but both had the same result. I copied the navbox/doc subpage, so I know the formatting is correct. I copied {Flatlist} to our Wiki just in case it was required, and it is working fine, but the {navbox} is still vertical. I can see the .navbar and .hlist entries in the Common.css files I copied, so I am not sure what else I missed.

I am going to start creating some custom templates using the .hlist styles to see if I can determine what is not working from the CSS.

Any pointers or suggestions would be greatly appreciated.

FlightTime (talkcontribs)

Here is a screenshot of a navbox on one of my wikis using the rules from your wiki I changed the border to red (the only change) just to verify that it's your wikis code being used, so it's apparent is not the .css rules.

FlightTime (talkcontribs)

The problem is your template is coded to be vertical. If you create a template like this then redo you template code thus

{{Navbox
| name   = Navbox/doc
| state  = uncollapsed
| title  = [[USA]]
| listclass = hlist
| group1 = [[USA/Northwest|Northwest]]
| list1  =[[Alaska]]{{•}}[[Idaho]]{{•}}[[Montana]]{{•}}[[Oregon]]{{•}}[[Washington]]{{•}}[[Wyoming]]
| group2 = [[USA/Southwest|Southwest]]
| list2  =[[Arizona]]{{•}}[[California]]{{•}}[[Colorado]]{{•}}[[Hawaii]]{{•}}[[Nevada]]{{•}}[[New Mexico]]{{•}}[[Utah]]
}}
86.155.238.230 (talkcontribs)

You also need to copy the css codes from wikipedia for navbox and navbar.

86.155.238.230 (talkcontribs)

Hi please also upgrade to Mediawiki 1.23.1 please. And update your extensions.

Kentsmith9 (talkcontribs)

I did copy the css from wikipedia for both of those as noted above. Was this a "make sure" statement or did you see something missing?

Kentsmith9 (talkcontribs)

I'm confused. The Wikipedia entry for navbox/doc uses the same bullet list that I am using and said the {*} template was deprecated in favor of the hlist class. Is it not working for my wiki because Wikipedia is using the Lua version and I am using the older script?

Kentsmith9 (talkcontribs)

Since the Wikipedia template suggests prior use of the {flatlist} was replaced with hlist, I plugged the flatlist template around my current list and it is operating in a horizontal fashion. It must be that the older script has differences never solved with hlist that is used in the Lua version of the template.

That also likely explains why my group headings are white (or transparent) and not colored like the Wiki navbox template shows with the same code example.

Kentsmith9 (talkcontribs)

And I forgot to say thanks! This definitely gives me a solution either way.

FlightTime (talkcontribs)

I had some schooling also, I wasn't aware of {{flatlist}}, we all got something :) thank you.

Kentsmith9 (talkcontribs)

After more playing around I found the solution to the other problem. Because I was using the older non-Lua script, I think there may have been changes to the (Common.css) page. I found that my implementation of the navbox was not displaying the typical background color for the first level groups. It was staying transparent. Somehow the css was missing the ".navbox-group" entry for the color. It only had ".navbox-abovebelow, th.navbox-group, .navbox-subgroup .navbox-title". Once I added the ".navbox-group" to that entry, all was good in my Wiki. I expect once I add Lua and use that template this problem will likely disappear. Also I expect the hlist to begin working without the {flatlist}. Thanks again to Mlpearc!

Reply to "Navbox not working 100%"