9 years ago
6
Topic

Hi Octopoos,

I am trying to build a tree with categories and articles in a module, so I could show it next to a blog or item view. I found your Form & List Pack field plugin and played a little with it to see if I could achieve what I just described with. First I followed this tutorial (Create a dynamic list within a list item) and I got a list with all categories and the deepest level categories showed a nested list with their articles. Then I tried to nest the categories, but I did not succeed so far. 

After following the mentioned tutorial, I added an extra List & Search type (category) and added the Category ID field and you field plugin to the List view. I added the CCK parent ID field to the search view of the previous Category list. In the feld plugin I added a field with "cck_parent_id=cat_id" and I pointed to the previous List & search type. Then I changed the List & Search type for the module to the second type.
The result was:

  • Category1
  • Category2
    • Category1
  • Category3
    • Category1
    • Category2

So my question is can it be done with your field plugin and how? OPr would you suggest another approach?

Kind regards,

Richard


Get a VIP membership
9 years ago
3
Level 1

Hello rvennix,

in the second categories search type, have you setup correctly the object ?

When you are editing the search type, in the header, at the bottom right, you have an orange arrow down. 

When you clic on it, you will see some parameters, in particular, the object on which the search will be performed. So here, you must set "Category".

Regards.

Lionel

9 years ago
2
Level 2

Hi Lionel,

Thanks for your reply, I checked it twice, but both category searches Object fields are set to category. I followed these steps (using _jrmo's tutorial as inspiration)

  1. Create a Subcategories Search / List (set Object to category) and make sure you have the "Category ID" field in your Item View (along with any other fields you want to display)
  2. Create an Articles Search / List type (set Object to Article) and in your Search Form view, make sure you have the “Article Category ID” field.
  3. Go back to your Subcategories Search / List Type and create a new SEBLOD List field (using the field plugin). 
  4. In the field List & Search Type fill in Articles
  5. In the "fields" options, fill in art_catid=cat_id.
  6. Create a Category Search / List Type (set Object to category) and make sure you have the "Category ID" field in your Item View 
  7. Go to the Subcategory Search / List and in your Search Form view, make sure you have the “CCK Parent ID” field.
  8. Go back to your Categories Search / List Type and create a new SEBLOD List field (using the field plugin).
  9. In the field List & Search Type, fill in Subcategories.
  10. In the "fields" options, fill in cck_parent_id=cat_id and save it

If I select the subcategories as the Search Type, I get a list of categories with their articles properly nested. But when I set the Search Type to categories, the articles are not shown, but the categories are ordered this way:

  • Category 1 (level 1)
  • Category 2 (level 2, child of Category 1)
    • Category 1 (level 1)
  • Category 3 (level 3, child of Category 2)
  • Category 4 (level 3, child of Category 2)
  • Category 5 (level 2, child of Category 1)
    • Category 1 (level 1)
    • Category 2 (level 2, child of Category 1)
    • Category 3 (level 3, child of Category 2)
    • Category 4 (level 3, child of Category 2)

 What am I missing here? Any ideas?

Regards,

Richard

1283 Posts
Bucklash
9 years ago
1
Level 3

+1

Did you work it out in the end?

572 Posts
_jrmo
9 years ago
0
Level 4

Hi guys,

If you're struggling with this I really recommend taking out a VIP membership and downloading the Intranet app, where this has been implemented already. That way you can pull it apart, analyse how it's done and then make your changes to suit your needs.

www.seblod.com/products/vip

1283 Posts
Bucklash
9 years ago
1
Level 1

Hi _jrmo

Thanks for the heads up re intranet app. I will check it out and when I get the chance will post my version of an answer.  

Jon

332 Posts
Kenneth
5 years ago
0
Level 2

Hi folks. Old thread, but still this is a struggle to setup. I've searched and searched, tested and tested, and no matter what I do I can not create a blog app that works well. Anyone managed to solve this?

Get a Book for SEBLOD