GWcode Categories Examples

Here are some examples to demonstrate what you can do with GWcode Categories:

Example 6 - Automatic nested numbering

With a couple lines of CSS code, we can get a list of categories with automatic nested numbering (sub-numbering for child categories) such as this:

  1. cat1
    1. cat1_1
      1. cat1_1_1
      2. cat1_1_2
        1. cat1_1_2_1
    2. cat1_2
  2. cat2
    1. cat2_1

The CSS:

ol.subcount, ol.subcount ol { counter-reset: item; }
ol.subcount li {
	display: block;
	margin: 0;
	padding: 0;
	font-weight: bold;
ol.subcount li ol li {
	display: block;
	margin-left: 25px;
ol.subcount li:before {
	content: counters(item, ".") ") ";
	counter-increment: item;

The plugin code:

{exp:gwcode_categories channel="example" list_type="ol" class="subcount"}
	<span style="font-weight: normal;">{cat_name}</span>