
Site Categories are the way we organize the site into a hierarchy of web pages. Each category may contain sub-categories, pages, or a combination of both. And the pages may be static or dynamic. The ShaneBow CMS category module, stores the categories using the nested set model.
We create and maintain the categories in the Admin section of the site using the Category Manager. Then we offer various ways to use these categories to traverse the web site, including:
- a sidebar panel that shows the category tree, with links to each published category listing
- default views to display the contents of a category
- A way to create and display a category — or multiple categories — in a completely custom view
Model
Category Metadata
id: the system assigned idid_page: the id of a custom page used to display this category. This value defaults to0which means that the category will use the default views to display it's contenttitle: the name of the category: e.g. My Very Cool Categoryslug: the way the category appears in aurlfor instance, enteringmy-very-cool-categoryas theslugwill result in theurl:/category/my-very-cool-categorymid: stands for media id and it is a link to the tron/hero image displayed at the top of a category listing view. If it is0, hero image is displayedicon: the icomoon icon representation of this category. It is used in the sidebar category tree, and in the default category lists to show a category that does not have a custom page to define an image for the listing
Tron Image
For sirijanda.com we like tron dimensions of 1280x488 == 960x366
Controllers
Cat- controls the backend
Page -
The Page controller controls the front end. There are some different ways to display
the contents of a category.
Views
admin
- route:
/cat/manage
cms-cat-manager.php.content
!layout:admin
<title>Categories</title>
~~cms/cats/ui/admin/cat-manager.view
UI Category Tree (sidebar)
<div class="panel cattree" >
<h3>Categories</h3>
<ul class="tree">
<?= file_get_contents('assets/files/cattree2.div') ?>
</ul>
</div>