klewas VIP
Total posts: 18
07 Mar 2014 14:59

Hello, I am creating my second website with cobalt 8 but still didn't get how it really works:) Maybe it's because the lack of tutorials, or i can't find them. So, I have a task but can't find how it should be properly accomplished with Cobalt8, I hope you can help me.

I need to create a website with products catalog, which should be grouped by categories, and it would be great that web admin could add records and new categories form frontend. Also I need add custom fields in categories (for example. country of the manufacturer, additional photos). If user comes to some category he should see some specific information that is relevant to that manufacturer and all the products of this manufacturer. I can't do that because admin can't create categories from frontend and he can't add some additional info to them.

What I did: In the section I have created manufacturers category, also I have type with all the fields I need for manufacturers which submits to this category. In the manufacturers category I created products subcategory and type for submitting products to this subcategory. In the producs type I have select field where I use SQL Source for selecting manufacturers from parent category ("SELECT id as id, title as text FROM #__js_res_record WHERE type_id = 1") so that admim could add manufacturer name to this product.

Problem: So manufacturers aren't categories, they are simply articles, and if i come to manufacturer page i only can get a manufacturer info but not all products related to this manufacturer. Of course I can use api for rendering articles list but i need to get them all and then filter throw the manufacturer name. And I don't think it will be a good decision. Also if i do it this way when I come to product breadcrumbs didn't show manufacturer category, because there is no such.

I am waiting your response and advice, because now I dont know I am doing it the right way:)

Last Modified: 11 Mar 2014


Sergey
Total posts: 13,748
09 Mar 2014 15:33

klewas it would be great that web admin could add records and new categories form frontend.

Categories from frontend impossible.

klewas Also I need add custom fields in categories

This is not how Cobalt works. What you are saying is an alternative CCK aproach. Right now there are 2 main CCK principle.

  1. Build content based on content types. You create object with desired fields and save it in any category you want.
  2. Build content based on category. Object is standard for everything but it may accept properties depending on category you place it to. Other words you add fields not to type but to category.

It is possible to use either one or another. Not posible to mix. And CObalt uses 1 menthod. As a result no fields for categories.

If you have different categories with different types, create new type for very category and limit type to be submited only to that category.

klewas In the manufacturers category I created products subcategory and type for submitting products to this subcategory

Those should be completely 2 separate sections. Create one section and type for companies and anothr section for products.

klewas In the producs type I have select field where I use SQL Source for selecting manufacturers from parent category ("SELECT id as id, title as text FROM #__js_res_record WHERE type_id = 1") so that admim could add manufacturer name to this product.

To bind manufacturer and product you may use relate parent/child fields. Or like you do also possible.

klewas Problem: So manufacturers aren't categories, they are simply articles, and if i come to manufacturer page i only can get a manufacturer info but not all products related to this manufacturer.

Immediately you get your pproblem solved if you have different sections and types for products and manufacturers.


klewas VIP
Total posts: 18
10 Mar 2014 10:45

Thanks to your response. I will try to do it in that way. Before that I didn't noticed the relation fields:)


Sergey
Total posts: 13,748
11 Mar 2014 09:34

klewas Before that I didn't noticed the relation fields:)

In fact the way you do it may be even more apropriate.

Powered by Cobalt