I’ve just relaunched the redesign of this site. Nothing major is different, but one fun thing that I’d like to highlight is the way the blogroll is displayed. I got the idea from Motel de Moka, which has more links to work with than I do.
First, I set up a very simple model:
1 2 3 4 | |
But we’ve got a problem at this point: we can’t order this by the number of characters in the name. So we must modify our model to have an integer called name_size, and then override BlogRollLink’s save function to fill in that field any time the model is saved. Our final model is below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Now to display this on every page, I’ve created a context processor named blogroll_processor. It looks like this:
1 2 3 4 5 6 | |
And we’re done! A nifty "waterfall" of blogs. Let me know what you think about this technique. Is it stupid?