Custom taxonomy: same terms, but for different years

You could indeed, achieve everything with categories, but is it a good idea? If all main categories are 2010, 2011, 2012 and each of them has subcategories named Room1, Room2, etc., you would indeed have an easy way to make your searches by year or by room. The search by year would be as simple as querying the corresponding category. The search by room would imply to first create an array or a list of cat numbers by looping through all categories to find all categories named “Room1” or “Room2” for all the years. With the list in hands, the search would be very easy to execute.
All this is fine and could be implemented quickly.
The only fear I have for you is that this solution is really a hack and not very “logical” condisering your data model. First: are rooms only assigned every year? Do they not get assigned by periods?
Repeating categories like this is not a clean way to represent data because you would be repeating information. A better idea would be to create custom post types for Rooms, Parkings, etc., and assign them to users for each year, for example associating a year and a facility through a custom field. All custom fields have unique IDs, using the same primary key as posts, so they are always clearly separated. So you could perfectly have fields associating a year and the ID of a facility with something like Y2010:F223 (223 being the ID of the parking place, etc.). Then it would be easy to make a search using the custom field values (searching for Y2010, Y2011 or F21, etc.).

Leave a Comment