Sfoglia il codice sorgente

documentation of optionnal setting "TAG_CLOUD_BADGE"

Ferry Jérémie 9 anni fa
parent
commit
9e1d20653a
1 ha cambiato i file con 20 aggiunte e 1 eliminazioni
  1. 20 1
      tag_cloud/README.rst

+ 20 - 1
tag_cloud/README.rst

@@ -42,19 +42,33 @@ Setting name (followed by default value)            What does it do?
 ``TAG_CLOUD_SORTING = 'random'``                    The tag cloud ordering scheme.  Valid values:
                                                     random, alphabetically, alphabetically-rev, size and
                                                     size-rev
+``TAG_CLOUD_BADGE = True``                          Optionnal setting : can bring **badges**, which mean
+                                                    say : display the number of each tags present
+                                                    on all articles.
 ================================================    =====================================================
 
 The default theme does not include a tag cloud, but it is pretty easy to add one::
 
     <ul class="tagcloud">
         {% for tag in tag_cloud %}
-            <li class="tag-{{ tag.1 }}"><a href="{{ SITEURL }}/{{ tag.0.url }}">{{ tag.0 }}</a></li>
+            <li class="tag-{{ tag.1 }}">
+                <a href="{{ SITEURL }}/{{ tag.0.url }}">
+                {{ tag.0 }}
+                    {% if TAG_CLOUD_BADGE %}
+                        <span class="badge">{{ tag.2 }}</span>
+                    {% endif %}
+                </a>
+            </li>
         {% endfor %}
     </ul>
 
 You should then also define CSS styles with appropriate classes (tag-1 to tag-N,
 where N matches ``TAG_CLOUD_STEPS``), tag-1 being the most frequent, and
 define a ``ul.tagcloud`` class with appropriate list-style to create the cloud.
+You should copy/paste this **badge** CSS rule ``ul.tagcloud .list-group-item <span>.badge``
+if you're using ``TAG_CLOUD_BADGE`` setting. (this rule, potentially long , is suggested to avoid
+conflicts with CSS libs as twitter Bootstrap)
+
 For example::
 
     ul.tagcloud {
@@ -76,4 +90,9 @@ For example::
 
     ...
 
+    ul.tagcloud .list-group-item <span>.badge {
+        background-color: grey;
+        color: white;
+    }
+
 By default the tags in the cloud are sorted randomly, but if you prefers to have it alphabetically use the `alphabetically` (ascending) and `alphabetically-rev` (descending). Also is possible to sort the tags by it's size (number of articles with this specific tag) using the values `size` (ascending) and `size-rev` (descending).