Forum:Infobox - How to add catagories

I've got an info box on Tractors.Wikia - http://tractors.wikia.com/wiki/Template:Infobox_Steam which has several entries which i'd like to use to automatically categorise the page its used in depending on the entries value, rather than adding categories to each page manualy. Items such as the build date - e.g '1913' would add "Category:Steam engines built in 1913" to the page, with similar for the Manufacturer, Power, Engine type etc. entries.

I'm sure i've seen it done but cannot remember how or were, and a look through help has not found the relevant page.

Part of the need to do this is the new (er) update to the wikia software with the 'magic' category add button now stops the copying of a similar existing page complete with the categories included in it and just up dating a few bits of text & the odd bit of some category entries. If the use of the infobox automatically adds the categories it will be easier & result in a more consistent indexing of pages.

A pointer to a suitable (not too complex) example on another wiki would be a great help. My earlier attempts to create a 'auto page creation button' based on another wikis complex template failed due to the complex nested coding / logic used. Thanks i'm sure its a simple solution but it escapes me for now - BulldozerD11 15:05, 4 August 2009 (UTC)


 * Then the best way would possibly be <-- that one should then be the infobox's value for the date it is build. Tedjuh10 - Talk 17:48, 4 August 2009 (UTC)
 * Just viewed the infobox, the should be . Remember you'll have to create the category's to. Tedjuh10 - Talk 17:49, 4 August 2009 (UTC)
 * Thanks Tedju10, So I just add them like the categories used on the /doc pages & just pass the relevant parameter like "Build_date" into the category description then. Is it best to have them in the line were the parameter is (used in the infobox), or stick them all at the Bottom of the template ?


 * Cheers for reminder about creating category as well, - I have a session of Bulk defining categories every so often for blocks of categories in sequences so they are all the same & cross link to related ones. It gets a bit tedious when there is nearly 200 (years) in the sequence - but this ones only about 70 years ~ 1870 ~ 1940 & the others much smaller. - BulldozerD11 19:41, 4 August 2009 (UTC)
 * I find that templates are easier to read when the "display code" is spearated from the categories. Also, you might want to consider using, that will make infoboxes that have no year given put them into Category:Steam engines built in an unknown year; but if the build_date= is specified but left blank, you'll get it in Category:Steam engines built in. Which is the reason why these other pages had the extra logic. -- ◄mendel► 09:58, 5 August 2009 (UTC)