Thread:Balagog gro-Nolob/@comment-6003396-20131122050803

I was looking at the standard weapons category page and thought it would be more useful if they were sorted by weapon type rather than alphabetically, especially once shields are added.

It seems that Sort Key would work well, but what would make it even more useful would be to have the sort headings the actual weapon type rather than individual letters, e.g., not having each crossbow, curved sword, and curved greatsword all under "C". What seems to be a solution is on the talk page, which requires modifying the base library code so that if the sort key is within parenthesis, it lists the full name of the sort key on the category page rather than the letter. function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; $titletext = $wgContLang->convert( $title->getPrefixedText ); $this->articles[] = $isRedirect ? ' ' . $this->getSkin->makeKnownLinkObj( $title, $titletext ). ' '     : $this->getSkin->makeSizeLinkObj( $pageLength, $title, $titletext ); if($wgContLang->firstChar( $sortkey )=="("){     $closepar=strpos($sortkey, ")"); $sortkey=substr($sortkey, 0, $closepar); $this->articles_start_char[] = $wgContLang->convert( trim($sortkey,"("));   }else{      $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );    }  }

In order to add the sort keys, I figured it would be easier to do it via the weapon template, since the weapon template already contains the weapon type info. It would still require adding an "upgrade-type" variable to all the weapon pages, the way that it is on armor pieces, though. But I was wondering if adding the upgrade-type variable would also be useful in laying the groundwork for a weapon database?

I have no idea how to edit the library code, or if changing it would cause any unforeseeable issues, are there any? I have an idea of how to go about the code for the category sort key on the weapon template, and am able to add the upgrade-type for the individual pages. Is this a good or bad idea, and is this the best way of going about it? Thanks 