Category talk:Naval ships of the United States

Latest comment: 17 years ago by Fabartus in topic Parent Cat Trees

Parent Cat Trees

edit

While exploring the possibilities of {{catlst}} one of my hot buttons came to roost, to whit, the default skin which is the only one available to the unregistered public, has the page categories off down along the bottom, below even the edit controls which take up a fair amount of height. So seeing categories on long pages is something of a problem. So I decided to see what a multilevel tree in a fairly complicated category would look like.

There are five categories on the page, and they were processed right to left building from the bottom to the top of the following illustration. Best advice, keep looking relative to the left margin, and the terminal positon of the category page 'Naval ships of the United States'. The bottom cats are duplicated just below and just above this table (sic):


Naval ships by country | Military equipment of the United States | Ships of the United States | United States Navy | United States Navy ships


 | Naval ships by country 
     | Science and technology in the United States
     | Military of the United States 
     | Military equipment by country   
 | Military equipment of the United States 
     | United States | Science and technology by country
             | Government institutions 
             | Categories by country 
             | Military 
           | Military | Categories by country | Government institutions 
         |Military by country | United States   
       | Military of the United States | Navies by country
     | United States Navy                       
     | | Ships                                  
   | Ships by navy 
       | Ships                                  
     | Ships by country
     | Science and technology in the United States 
     | Water transportation in the United States 
     |Science and technology in the United States | Water transportation in the United States | Ships by country
   | Ships of the United States
 | United States Navy ships}}

Naval ships of the United States


Naval ships by country | Military equipment of the United States | Ships of the United States | United States Navy | United States Navy ships


initial saves // FrankB 03:09, 28 January 2007 (UTC)Reply

Wikipedia parent and upper level categories
Naval ships by country, Science and technology in the United States, Military of the United States, Military equipment by country, Military equipment of the United States, United States, Science and technology by country, Government institutions, Categories by country, Military, Military, Categories by country, Government institutions, Military by country, United States, Military of the United States, Navies by country, United States Navy, Ships, Ships by navy, Ships, Ships by country, Science and technology in the United States, Water transportation in the United States, Science and technology in the United States, Water transportation in the United States, Ships by country, Ships of the United States and United States Navy ships

This failure actually suggest something... the breaks occur at ]], which don't wrap. I would assume that an all macro version would enable one to lay out just this sort of programed diagrammatic input on a page... which would lead to much better documentation, and ease of use and maintenance going forward. // FrankB 03:24, 18 February 2007 (UTC)Reply

The problem is that the formatting before and after the category name is retained and included in the parameter passed to the template. So instead of 'Naval ships by contry' you are sending:
' Naval ships by country 
 '

The template then converts that into [[:Category: Naval ships by country | Naval ships by country]].

Thus, this really doesn't have anything to do with the brackets (']]'). If all the extra spacing is removed the template call above works fine. Offhand I can't think of a way to allow parameters to be formatted with various indenting levels in the page source which would not also pass that formatting to the template. A single line break will get stripped out such that a long vertical list is not a problem, but spaces with interspersed linebreaks are more than the parameter parsing is set up to handle... they are assumed to be part of the parameter text to be passed. Which they need to be - for cases where you really are trying to pass formatted text as a parameter. --CBD 21:40, 25 February 2007 (UTC)Reply