Jump to content

Module: Select Multiple Transfer


ryan
 Share

Recommended Posts

I had some updates to push on dev related to InputfieldPage and the <select> dependencies, so went ahead and did that, just so that we're all testing on the same version of things here. 

This is a little off-topic here, but wanted to mention before I forget: 

@Soma: I implemented something so that you can specify which classes should behave like InputfieldPageListSelect/InputfieldPageListSelectMultiple, where the "parent" setting reflects the root of a tree rather than an immediate parent. Rather than having those hard coded in the class, they can now be specified by making your class implement the interface "InputfieldPageListSelection". This interface doesn't currently require any methods, so it's a blank interface. You can have your Inputfield class defined like this to be treated as a tree selection:

class YourInputfield extends Inputfield implements InputfieldPageListSelection {
You can get the drag'n'drop order of the selected pages. Is is possible to get the order of the non selected pages to ?

Non-selected pages aren't actually part of the POST submission. They are no different from unselected items in a <select multiple> ... actually that's exactly what they are behind-the-scenes, as this jQuery UI widget is just a progressive enhancement to <select multiple> in the same way that asmSelect is. The data that they represent can't go beyond what is represented by a <select multiple>. 

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

I am impressed by this powerful module, it makes editing a lot faster for multiple select fields!

Just wondering if there is any possibility, that all selected options will be sorted automatically by name? In general they are reverse sorted by date added...

Link to comment
Share on other sites

They will be presented in whatever order is used by the parent you are pulling them from. I'm guessing in your case that the parent page used for your selectable options is configured to sort the children by date. You could change this by configuring your Page reference field to use a selector string rather than a parent. This should do what you need:

parent=/path/to/your/parent/, sort=name

Link to comment
Share on other sites

  • 1 year later...

This looks like a great module, thank you!

I came here searching for dependent select options with PW.

Now I'm reading that the video demo uses dependent selects. That is exactly what I need. But I can't seem to find a fieldtype "dependent selects". Is this part of some other fieldtype that I need to install first or how do I set up 2 dependent select fields in the backend? 

Link to comment
Share on other sites

Dependent selects is not fieldtype but a technique to use the custom selector for the pagefield inputfield. You can use 'page' or 'page.field' in there to make one select dependent on an other select on the same page when editing. Ie 'parent=page.anotherpageselect'

  • Like 1
Link to comment
Share on other sites

@Soma

Thank you for clarifying

I was thinking of it as an extra field type because "parent=page.anotherpageselect" is only working for pages that live under the same parent like you explained here.

I'd need something more flexible that can be applied to page select fields whose pages have different parents. Meanwhile I posted about this in Wishlist&Roadmap.

Link to comment
Share on other sites

@gebeer, yeah I said that but also said that another selector would be required and that I didn't know if that would work. But I just tested and it works fine.

What you need is this type of selector:

"select_page=page.select_country, select_page!="

Setup

"select_page" = would be page single page select field on your option pages to select its "reference", like "Zürich" has selected "Schweiz", and so on

"select_country" = would be a normal page select on current editing page to select from a parent of countries. Nothing special here. 

Then use a page select to select cities that are dependent on what country is selected:

"select_area" = would be a normal page select on current editing page to select from cities. Here you would use the custom selector option for the input like: "select_page=page.select_country, select_page!="

And so on. You can go further and create a page select that is dependent on the selected city and add a "select_event" that then uses same selector but with using "page.select_city":

"select_page=page.select_city, select_page!="

post-100-0-78812200-1428654752_thumb.png

post-100-0-65081500-1428653837_thumb.png

This allows dependent relations using a page select instead of a parent relation. This is only for backend.

  • Like 1
Link to comment
Share on other sites

@Soma

that looks great!

I am only having trouble understanding where exactly I need to put the "select_page" field and what the selector for this one would be. Because I am not sure what  "options pages" refers to. Are these the area and event pages in your example?

EDIT: I got it working now for my scenario. Thanks again.

-destination template with title and country single page select field

-tour template with title, country field and a destinations multi page select field with custom selector "country=page.country, select_page!='', template=destination"

Link to comment
Share on other sites

  • 3 weeks later...

Having some luck with this but can't seem to use it for this scenario...

Selectable items are parented to various "group" pages. They also have a page field for their "type" (typical pages-as-categories kind of thing).

On the template of the page where I need to select these items, I can setup a group page field and make my custom selector string use that for parent, OR I can setup a type page field and make my custom selector string use that for type, BUT I can't do both (it doesn't find anything).

This works:

parent=page.item_group, page.item_group!=''

This works:
item_type=page.item_type, page.item_type!=''

This does not work:
parent=page.item_group, page.item_group!='', item_type=page.item_type, page.item_type!=''
 

Edit:

Apologies for extending the somewhat tangential dependent selects discussion in this "Select Multiple Transfer" topic.

As for Select Multiple Transfer, I can't get it to show up in 2.5.26 dev as a choice among the other input fields. Have uninstalled/reinstalled.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...