i’m building a nature site with a custom router which uses taxonomical names for navigation and css. Everything is working but i have a small problem and i’m not sure what to do about it other than use a substring check. Here is the problem:
for birds, the path for the router is Animalia/Chordata/Aves. For all ranks, i use the rank as the name of the css file which controls the display for the rank options. Aves (birds), however, is further divided into orders. I do not use orders but i built them into my design incase someone wants to know how birds are structured. So all passerine birds will be viewable under Passeriformes. I do not have a Passeriformes css file. The code is in the Avess.css file. My template only displays the path name .css which is working for everything except bird orders.
I decided to check for ‘formes’ in the substring. so if substr $path -6 === ‘formes’ then write aves.css. I think that a substring check will slow down the site a bit, yes? is there a better method for this? i don’t want to make over 30 css files which contain the same info found in aves.css. This is only a problem with birds because i want to use orders as a convenience.
any ideas of how to do this better and easier than a substring check?