1283 Posts
Bucklash
9 years ago
0
Topic

Hi folks, this post is to help those that are a little stuck on the tutorial:

HOW TO: Seblod Dynamic Cascading Fields

I found that the tutorial used a version of this field that is slightly different to the current version (1.2.1)

Attached are screenshots showing how I achieved the desired result.

The info for the States field... 1 of 2

.

The info for the States field... 2 of 2

The info for the Cities field... 1 of 2

The info for the Cities field... 2 of 2

The Category info for States in the DB... 1 of 1

The Article info for Cities in the DB... 1 of 1


AS A FOLLOW ON, I have added some more info, this might change as I fine tune it and make it more accurate...

STATES Dynamic Select (The field that lets you choose the State):

The construction1 section:

  • Label: What ever you want it to be...
  • Default value: not really sure.
  • Query: Construction or free. Free is the ultimate choice (when you know what you are doing). Free means you write the SQL query yourself.
  • Select Label: This is seen on the front end as 'select from list' etc depending on what you put here. Also, if you select auto hide, this will not show if there is only one option.
  • Behaviour: Start, middle or end. Important to label the start field, middle field (not relevant in this demo as there are only two fields) and end field appropriately.
  • Group Identifier: This must be in the format of a machine friendly name, ie no spaces and is used on all of the fields in the cascade.
  • Table: The table in which content will be pulled ie #__content or #__categories.
  • Where: get data from where, in this example it is the categories with parent category of Australian States and Territories which in my database happened to be id=15, so it is categories with parent_id=15. (To take it further, you can play with this value, try id<=15, it pulls all the categories with an id 15 and less)
  • Options Name*: The data that will be visible in the select list. the column title is used in this example.
  • Options Value*:  The value that will be stored in db and passed to the next field (not exactly sure about this but I think the next field in the cascade uses this value). In this example it is the column id

CITIES Dynamic Select

  • Label: as above.
  • Default value: as above.
  • Query: as above.
  • Select Label: as above.
  • Behaviour: as above.
  • Group Identifier: as above.
  • Table: as above.
  • Where: in this example it is the articles with the category selected in the previous field. The column 'catid' works.
  • Options Name*: as above.
  • Options Value*:  The value that will be stored in db (not exactly sure about this but I think the next field in the cascade uses this value). This will be passed to the next field if there was one
  • Parent*: this is the value form the current table that matches the value passed form the previous field.
Get a VIP membership