Whew! More to say on Blogger categories. I have been immersed all day in further refining Daniel Chong Jyh Tar's amazing Blogger category fix, which I have implemented on this site and blogged about twice already.
Dan's workaround is based on Blogger's search feature, which itself derives from Google search syntax. In a previous post, I wrote about how to tweak your query before using Dan's code generator by employing a phrase search (enclose term in double quotation marks) or by brainstorming a list of words separated by Google's OR operator ( I ). This worked, but I still wasn't happy with the results. I have been experimenting further, and have discovered a couple of important things:
- Because it's the Google search (or some variation thereof), you can use the exclusion operator (-). This is great, because you can tell Blogger to pull up all the pages containing one of a set of words, but NOT another word. Just add the word you wish to exclude at the end of the query code in the Blogger template before the final quotation mark. Precede the word with a minus sign. You can exclude multiple words. Just place a minus sign before each, like so: -hack -hacks. This is a great workaround, and I used it to prevent the Blogger template hacks from appearing in the Tools and Resources category. Take a look at the code here.
- The only hitch I found is that Blogger seems to have some sort of word limit, and you may have to remove a couple of words from your list of ORs. This is strange because Google extended its notorious 10-word limit t0 32 words a long time ago. Doesn't seem to work in Blogger though. If you have trouble getting your exclusion to work, try eliminating a couple of the words in your list of ORs.
- I also got strange results combining a phrase with a set of ORs and an exclusion, as in this example: "web design" I HTML I CSS -hack -hacks. Blogger produced completely erroneous results, though this works typed directly in the search field rather than the template. This needs further tweaking, and the Blogger people could certainly improve the query language.
- In the process of re-working my categories yet again, I began to realize how much careful thought you must put into word choice as you write, since the words you use become the keywords Blogger search will use to achieve logical, intuitive topic clustering. Search engines are very literal: if you have used the word tool in talking about, say, a light meter for a camera (using this site as an example), that posting will show up under both Photography I Photoshop and Tools I Resources. That might be OK, but it might also make your topic clustering less intuitive to readers.