Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
KK,

Probably you have seen this type of editable field in Drupal - here is a short video (best at 5:26)
https://www.youtube.com/watch?v=kO3qXTE ... u.be&t=326

So it's kinda a single dropdown field, but supports hierarchy and is visually represented by dynamic number of select elements.

Any chance on adding this to Couch?
No, I hadn't seen that Anton; thanks for the link.
I'll take a look.
Hi Anton and Kamran,

I want to say that this functionality would be very powerful. In many cases I have problems because at this point it is missing.
Please for such a decision!
@trendoman, @orbital,
Maybe I am a little thick skulled but could you please make me understand the utility of this (apart from the obvious cosmetic factor)?

I mean, I can understand the importance of cascading dropdowns in scenarios where each dropdown fetches data from a *separate* template and the templates happen to be related to each other e.g. Manufacturer, Product etc.

In the given video, however, the data source is a single hierarchical tree. So, say we were to display the tree in a single dropdown (e.g. as is done for folders in Couch), how is that approach different (again, not taking the cosmetic angle into consideration)?

Am I missing something obvious? Please correct me.
Kamran,

If such hierarchical 'folders' tree has over 20000 elements as in Ivo's case, it creates certain inconveniences. Ajaxified loading of the tree would be a solution.

The other use case (separate templates Vs single template with multitude of folders) looks very similar to me.
Hi Kamran,
It's really about quantity, here's a real example -
In one of my e-shops there is a main folder "Products"
It has sub folders (categories ) "Summer tires" "Winter tires" "Car accessories" ...
In each of these category folders, there are sub sub folders for subcategories that exceed 100 - 200 for each.
At this point, they are all dissolved and the administrator has difficulty finding the necessary folder to create or edit a product.

However, there is also a significant technical problem.
If the folders are 10,000 browsers should display all folders each time the page is loaded and a significant delay is observed.
However, if only the main folders are shown and not all available folders then the browser will show very few folders and so it should be.
I created two solutions for this subject. Only my task was a tad different.

One, it is based on skipping folder / pages listing completely ( makes browser and Admin panel responsive again ) — Administrator enters first letter and dropdown (query to backend) offers variants that has this letter in title. Letter-by-letter, there are narrowing options and this allows to quickly establish parent-child association.

Two, I placed a dropdown with dynamic opt-values (only top-level) inside a row. Modded "content_form" theme snippet to show the top-level (or 2-level, if there are few <options>) dropdown on create-view screen. Then Administrator saves the page and another (second) children dropdown (with inner folders options) appears only on edit-view screen. If Administrator decides to change parental association and clicks the top-level first dropdown, it triggers the form submit → page saves and reloads with new values in the second dropdown again. Administrator chooses the folder in second input and that's it.

P.S. Modding content_form is pretty fun. On another template In create-page view I offer a choice with radio and on edit-view completely skip this radio by not outputting it at all. I remember a question left without answer about hiding a controlling checkbox.This also applies to such cases.
7 posts Page 1 of 1
cron