News Browsecat Template: Arrange Categories as Columns
Posted: Tue Dec 20, 2016 1:27 pm
Hi All,
I am needing a little assistance... I would like to write a browsecat template that allows all sub-categories to be arranged into columns according to the first parent categories. The structure looks like this:
Newsfeed (parent)
- UK
- Europe
- Asia
Projects (parent)
- Golf
- Sports
- Design
Services (parent)
- Golf
- Sports
- Design
I would like to sort the parent categories into columns using div tags for each column, so that I can set the class of each column div to match my responsive grid layout framework.
The simplistic intention is for the template to render as this:
<div>
<h3>Parent category 1</h3>
<ul>
<li><a>Sub-category 1</a></li>
<li><a>Sub-category 2</a></li>
<li><a>Sub-category 3</a></li>
</ul>
</div>
<div>
<h3>Parent category 2</h3>
<ul>
<li><a>Sub-category 1</a></li>
<li><a>Sub-category 2</a></li>
<li><a>Sub-category 3</a></li>
</ul>
</div>
<div>
<h3>Parent category 3</h3>
<ul>
<li><a>Sub-category 1</a></li>
<li><a>Sub-category 2</a></li>
<li><a>Sub-category 3</a></li>
</ul>
</div>
Help would be very much appreciated!
I am using version 2.1.5 “High Rock”
I am needing a little assistance... I would like to write a browsecat template that allows all sub-categories to be arranged into columns according to the first parent categories. The structure looks like this:
Newsfeed (parent)
- UK
- Europe
- Asia
Projects (parent)
- Golf
- Sports
- Design
Services (parent)
- Golf
- Sports
- Design
I would like to sort the parent categories into columns using div tags for each column, so that I can set the class of each column div to match my responsive grid layout framework.
The simplistic intention is for the template to render as this:
<div>
<h3>Parent category 1</h3>
<ul>
<li><a>Sub-category 1</a></li>
<li><a>Sub-category 2</a></li>
<li><a>Sub-category 3</a></li>
</ul>
</div>
<div>
<h3>Parent category 2</h3>
<ul>
<li><a>Sub-category 1</a></li>
<li><a>Sub-category 2</a></li>
<li><a>Sub-category 3</a></li>
</ul>
</div>
<div>
<h3>Parent category 3</h3>
<ul>
<li><a>Sub-category 1</a></li>
<li><a>Sub-category 2</a></li>
<li><a>Sub-category 3</a></li>
</ul>
</div>
Help would be very much appreciated!
I am using version 2.1.5 “High Rock”