3 Online. Join themUsers

Search

Hello,

I was thinking about a Select Box that can filter it’s options by another field on the section (like Reflection Field’s {entry/})

For example (a racing league emsemble):

You have a Section called Chassis with the following entries:

  • Chevy Impala
  • Dodge Charger
  • Chevy Silverado
  • Dodge Ram

You have a Section called Series with the following fields:

  • Series name [Text Input]
  • Chassis allowed [Select Box populated by Chassis section, multiple selections]

In this Section you create a entry like this:

  • Series name: Sprint Cup
  • Chassis allowed: Chevy Impala, Dodge Charger

Now you have a Section called Driver with the following fields:

  • Car number
  • First Name
  • Last Name
  • Car : Series [Select Box populated by Series name]
  • Car : Chassis [Select Box populated by Chassis filtered by the option selected on the Car : Series field]

So in this case when adding a new Driver, if you select Sprint Cup for Car : Series the Car : Chassis field will only display Chevy Impala and Dodge Charger, not all the entries of the Chassis section.

Am I clear? How hard is to explain it all with words! lol This is a “good ideia” or already has a easy way to do that?

You mean like the Publish Filter extension?

No, I think what FabioPittol is after is a way to filter select boxes based on previous selections when creating an entry.

Another analogy for it could be the old. Country -> State -> City.

When choosing your the Country, the States are filtered, when choosing the State, the cities are filtered.

As fair as I know, there isn’t a way to currently do this, but yes, I agree it would be a nice extension :)

This is precisely the sort of thing that will be made possible when the good old REST API is finished.

Oh, country/region/town sort of thing? I do that on a timeshare site I built.

Basically, I use the Categories extension to generate my list of countries, states and towns (they have to be entered one at a time but since I only enter ones I need it’s not that big a deal) and then you can pull that into a select box which will break it down to Country / Region / Town.

Is that more what you’re after?

Yeah, is really something like country/region/town (nice analogy brendo)

doug, what’s this Categories extension you’re talking about? It’s a stand-alone extension? Or a built-in feature of the system?

Sorry, the extension is actually called Nested Cats and it is no longer on GitHub or the extensions section…

My guess it’s a dead extension. Well that’s a bit problematic as I’m using it on two different sites!

Well, that sucks. Right, so does anyone have another solution? The only thing I can think of is to use the Address Field to enter in all addresses and then build your site-side selectbox with some XSLT templates. Wow, that’s not going to be fun.

Sorry if addresses aren’t really what you’re trying to do here. Nested Cats was my go-to solution otherwise.

Maybe you could create a section called categories that would allow you to choose another category as your parent? I’m not sure how that would work in Symphony but you could build out the whole thing easily on the front-end.

Symphonians don’t like to be beaten. There must be a way of incorporating this into a custom field type somehow.

lol

On the showcase of the sites using Symphony I found one which has this kind of country/city thing.

http://www.no-excess.nl/storelocator/

I don’t know if they used the extension Doug mentioned or created it’s own :/

You select the Country, it filters the Cities and also show you a list of Stores when you hit Enter.

But that’s on the front end. Building this type of thing on the front end would be easy enough. It’s creating a Symphony field for the back end with this functionality that’s a bit more challenging.

Yeah, you’re right…I forgot ‘bout that!

Just found the Nested Cats extension in a package on Github. But I’m getting a Fatal Error trying to save a Section with this field. :/

Here’s the error:

Column 'parent_section_id' cannot be null

An error occurred while attempting to execute the following query

    * INSERT INTO `sym_sections_association`

(parent_section_id, parent_section_field_id, child_section_id, child_section_field_id, cascading_deletion) VALUES (NULL, ‘5’, ‘7’, ‘134’, ‘no’)

Backtrace: 

    * [C:wampwwwlbnsymphonylibtoolkitclass.mysql.php:275]

MySQL->__error(); * [C:wampwwwlbnsymphonylibtoolkitclass.mysql.php:219] MySQL->query(); * [C:wampwwwlbnsymphonylibtoolkitclass.field.php:142] MySQL->insert(); * [C:wampwwwlbnextensionsnested_catsfieldsfield.nested_cats.php:170] Field->createSectionAssociation(); * [C:wampwwwlbnsymphonycontentcontent.blueprintssections.php:705] fieldNested_Cats->commit(); * [C:wampwwwlbnsymphonylibtoolkitclass.administrationpage.php:119] contentBlueprintsSections->__actionEdit(); * [C:wampwwwlbnsymphonylibtoolkitclass.administrationpage.php:100] AdministrationPage->__switchboard(); * [C:wampwwwlbnsymphonylibtoolkitclass.administrationpage.php:70] AdministrationPage->action(); * [C:wampwwwlbnsymphonylibcoreclass.administration.php:88] AdministrationPage->build(); * [C:wampwwwlbnsymphonylibcoreclass.administration.php:204] Administration->__buildPage(); * [C:wampwwwlbnindex.php:20] Administration->display();

Login to Comment

Symphony • Open Source XSLT CMS

Server Requirements
  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 4.1 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts