37 Posts
austenn01
8 years ago
7
Topic

Hello,

I am using Seblod for normal articles, an events directory, and a business directory. This means that I will have a category structure similar to the following:

- Articles

- Events

---South Australia

---Western Australia

---Victoria

---Norther Territory 

---etc etc

- Business Directory

---auto

---holidays

---travel

---etc etc

In the admin and frontend submission forms, I need to restrict the categories that are shown depending on the content type that the user chooses. EG: if someone chooses to add an Event, then when they go to select the category for the event, they will only be shown the sub categorys below the 'Events' top level category.

Can anyone advise how I would go about doing this?

Thanks,

Get a Book for SEBLOD
572 Posts
_jrmo
8 years ago
3
Level 1

Hi there,

For this, the best way is to use a new, custom Select Dynamic field. That way you can specify the parent_id of the parent category. 

You can make a few of these, and ensure that they all have the storage Standard->Article->catid so it actually impacts which category the article is stored in.

Cheers,

James

37 Posts
austenn01
8 years ago
2
Level 2

I hate to be annoying, could you possibly provide a screen shot of how the select dynamic field should look? I am new to Seblod.

Also, whats the difference between the Select Dynamic Field you mentioned and the 'Select Dynamic Cascade' http://www.seblod.com/products/2997

Thanks,

37 Posts
austenn01
8 years ago
1
Level 3

Hello,

I worked it out from this video:

https://www.youtube.com/watch?v=_uic8R3TF2Q (this video is for the cascade plugin, but most of the parameters are correct. Heres a tutorial:

1) add field Dynamic Select

2) query = construction

3) table = #__categories

4) where = parent_id=89 (where 89 in my case is the top level category ID, and I want all the sub categories of category ID 89 to show in a drop menu)

5) options name = title

6) options value = id

Everything else is left as standard. I havent thoroughly tested this yet, but it works in the form view.

12 Posts
Hozefa Saleh
7 years ago
0
Level 4

Hi, Your trick works perfect, but what if we also need to show sub-sub categories of the main category? In my case I am creating a directory site where category have sub categories and then sub categories have further more sub-sub categories. So when for example I select the catid of main category "Directory" the subcategories are showing but sub-sub categories are not showing. What query change we need to do with dynamic select field ?

4229 Posts
Kadministrator
7 years ago
1
Level 1

There is a nice article on getting nested sets like categories is

http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

12 Posts
Hozefa Saleh
7 years ago
0
Level 2

Thanks for your reply @Klas , But it is difficult for me to understand these mysql queries for me :( I am not much proficient in database management. It would be helpful if you can provide me a sample criteria based on the seblod dynamic fields option to show sub and sub-sub categories list of a Main parent category ?

Thanks

4229 Posts
Kadministrator
7 years ago
0
Level 1

Hi,

I can only give you general directions, you need to do actual implementation yourself or you can get seblod experts to do it for you

http://www.seblod.com/store/services

Get a Book for SEBLOD