Multi-Level Tags in Sidebar

Jun 26, 2005 00:48


This is code to display your tags in a sidebar box. By naming your tags using a delimiter, for example animals:cats:tabbies or animals:cats:siamese, where the colon is the delimiter, you can display a heirarchical list of tags. If you feel your tags list will take up too much space in the sidebar, there is example styling provided to limit the ( Read more... )

!old, sidebar, tags

Leave a comment

boutondor October 6 2005, 12:53:06 UTC
I feel really stupid because I must be missing something way obvious since no one seems to have that problem but my tags don't look like that screen cap at all. It's just all of my tags listed one after the other in alphabetical order. How can I make it like yours?

Reply

murklinstest October 6 2005, 17:38:54 UTC
Looking at your layout, what you need to do is add some delimiters to your tags. So if you post a lot of icons for different fandoms, you might want to tag the posts that have icons for Veronica Mars as "icons:veronica mars" while the ones specific to Lost could be tagged with "icons:lost". Posts that include icons from many different fandoms might get several tags, one for each fandom (icons:lost, icons:veronica mars, icons:farscape). Or, you could choose to use a single multi-purpose tag like "icons:multi-fandom". That's up to you.

The result of using the colon in your tags is a nested list, which should look like this:

icons
farscape
lost
veronica mars

Reply

afuna October 6 2005, 18:15:20 UTC
In a situation such as this, where the tag categories are mixed up a lot, would it be better to use the layout-controlled tagbundles instead of tagname controlled ones? (Ah for official LJ-implemented tag bundles...)

Reply

murklinstest October 6 2005, 18:37:08 UTC
Also an excellent idea! Now where's that code again?

(Some explanation for boutondor: This community uses the bundle approach, which you can see in its sidebar. You start off by picking some overall bundle names, in the comm's case, "By Topic", "By Account Type", "For Official Use Only" and "Special". Then in some theme layer code you specifically assign certain tags to the different bundles. The code will automatically generates a two-tiered list, with tags associated with each bundle geting listed under the appropriate bundle name. The benefits are that you don't need to change any tag names -- your tag names can remain quite simple. Also, you can assign a single tag to more than one bundle. The downside is that whenever you want to add a tag to a bundle, you need to make a very minor tweak to your theme layer code. Also, it really only works in a two-level list situation -- you couldn't have a more nested list.)

Reply

afuna October 6 2005, 18:40:43 UTC
I saw that! :P

Now where's that code again?

It's um, around, somewhere *shifty-eyed*

Reply

boutondor October 6 2005, 22:02:11 UTC
Thank you so much! And do you know how I can get rid of those bullets that magically appeared?

Reply

murklinstest October 6 2005, 22:17:47 UTC
Hmm. Did you make sure to merge the styles in this post's Page::print_custom_head function into your theme layer's version of that function? You only need the first section of styles (/* List Alignment */) -- that should line the list up under the Tags header and also remove the bullets. The blue block is only if you want to add a vertical scrollbar.

Reply

boutondor October 7 2005, 22:08:19 UTC
I figured it out. Thank you for all your help :)

Reply


Leave a comment

Up