Snippet List
This Template Tag computes the font-size of two given arguments and returns a CSS-encoded string like "font-size: XXpx;", which can be used to format the font-size of link. (The minium font-size must be set with CSS.)
Requires two arguments:
1. occurrence of the current tag
2. sum of all occurrences
It works great for my tag-cloud.
[Source of the logarithmic formula](http://www.php.de/php-fortgeschrittene/44928-tag-cloud-algorithmus-fuer-schriftgroessye.html)
**Usage**
`<a href="http://www.anything.com" {% cloudify variable.occurrence overall. occurrence_sum %} title="anything">any tag</a>`
This is a simple template tag to create Tag Clouds. Based on the number of Posts (change the model_name according to your schema), Tags are provided different size ( most number of posts => most popular => and hence the largest.
We create a property called cloudsize for each tag, which is an integer between minsize and maxsize.
Check the example of sample template use here http://www.djangosnippets.org/snippets/472/
- tag
- template-tag
- tagging
- clouds
- cloud
This is a simple template tag to create Tag Clouds. Based on the number of Posts (change the model_name according to your schema), Tags are provided different size ( most number of posts => most popular => and hence the largest.
We create a property called cloudsize for each tag, which is an integer between minsize and maxsize.
- tag
- template-tag
- tagging
- clouds
- cloud
4 snippets posted so far.