#1 June 19, 2014 1:30pm

varavin
Member
Registered: June 19, 2014
Posts: 3

How can I create tree-like categorized lists/catalogs?

There's a very common need of creating something like, let's say, a catalog of goods - a number of sections which has sub-sections which, in turn, has a number of goods or other items.

As I can see so far, I can create a tree-like structure of categories in one module and a list of goods in other module, and connect each item to  some sub-category. But it is pretty inconvenient. For example, it's impossible to open an arbitrary category's items list - you have to create a view for every specific category.

One can also create a tree of pages, but you cannot assign different field types to a page, which is also bad.

I hope I just doing something wrong and there is an easy way of doing that. Can anyone help?

Offline

#2 June 19, 2014 1:38pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: How can I create tree-like categorized lists/catalogs?

BigTree's philosophy for module creation is that separate data types should live in separate views. So in your example of goods and categories, they are two separate data types with distinct needs which would be served best by two different views. You can group your goods in their view by their category or you could just include their category as a column in the view alongside the good's name.

Pages, on the other hand, is designed to essentially do the heavy lifting of the site's routing and simple page drawing. It's not designed in a way that you could, for instance, add a price field arbitrarily to a page. You can, however, create a routed template that is related to a module that can draw its own "child" pages based on module content (such as categories or goods). Implementing the module class's getNav method will allow it to provide subnavigation to any page with the related template:

http://www.bigtreecms.org/docs/code/cor … le/#getNav

Offline

#3 June 19, 2014 1:55pm

varavin
Member
Registered: June 19, 2014
Posts: 3

Re: How can I create tree-like categorized lists/catalogs?

Well, it looks like I've got things right, thank you. The front-end flexibility is a thing I like most of all in Bigtree, so I'll try to keep up with some back-end issues )

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.