LostKobrakai Posted February 16, 2015 Author Posted February 16, 2015 Just thinking out loud if you are looking for something to do As if I didn't talk about other modules on the todo list in another thread. But actually it's not an inputfield which is bound to be used with FieldtypePage, as this states in the module declaration. ... extends InputfieldSelectMultiple implements InputfieldHasArrayValue The module does add itself automatically to be usable with pages in the settings of FieldtypePage, so maybe it's only missing it's entry in FieldtypeOptions' settings. I'll test this tomorrow and if it's that way, I'll add the addition/removal to install() and uninstall(). 2
LostKobrakai Posted February 17, 2015 Author Posted February 17, 2015 I've just checked, the module does work out of the box with FieldtypeOptions, so nothing to do for me Edit: At least for the "Interface". Seems like Ryan did not include an option for adding new options from the inputfield by now, like it's for FieldtypePage. The thing I don't like about including it myself is, that I can't really guess a value for the field, while this would give the ability to change the wording afterwards, even if it's only a typo. Maybe we should first ask Ryan if he could implement a standartised way for auto values, then it would be easy to include a "add option" field like for pages. I'll open a feature request over on github. 3
adrian Posted February 25, 2015 Posted February 25, 2015 Just a quick note - there seems to be a bit of an issue on touch screens. Not sure if it is something related to your module, or the chosen library itself, but the first time I tap on the field, it automatically selects and adds the first page to the list of selected items. After that I can tap again and no selections are made. This happened to me on Chrome on iOS, but I haven't tested other browsers/devices.
LostKobrakai Posted February 25, 2015 Author Posted February 25, 2015 Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (more information). That the statement on the projects page. I've just tested it on safari and it's not loading, so maybe chrome in iOS isn't properly detected as mobile browser.
adrian Posted February 25, 2015 Posted February 25, 2015 Interesting - chosen actually works on tablet sized devices, but is disabled on phone sized ones. The issue I mentioned above doesn't seem to be an issue on Safari on tablets. Having this not work on phone sized devices though is quite a problem - the selection of existing pages works well enough, but not being able to add new ones is a deal breaker for me. I haven't tried it yet, but there is this fork of chosen that claims to work with mobile devices: https://github.com/rafalenden/chosen Maybe your module could fallback to ASM select with a textarea (for creating new pages) if on phone sized? Or maybe some other option - there has to be a cleaner way Not sure the best option yet - will think about it more later.
LostKobrakai Posted February 25, 2015 Author Posted February 25, 2015 If chosen is not working is should report this back, so I should be able to just unhide the textarea to allow adding of pages. Edit: Just pushed a commit to add this. Now you can at least add pages. Will take a look at the fork later. 1
LostKobrakai Posted March 29, 2015 Author Posted March 29, 2015 I've just added a new version of the module on the dev branch. A request for a single select inputfield powered by the chosen library came up on github. So I implemented it, which does mean the current inputfield is renamed to …SelectMultiple. I still want to add some more fitting styles, but it would also be nice to have some feedback if everything is still working for you guys, before I merge it to master. 2
Peter Knight Posted March 29, 2015 Posted March 29, 2015 I love this field type. A user of mine needs to select several pages from 100s and the tree traversal wasn't quick enough to be practical. One thing we do miss iS the ability to reorder chosen pages like the regular page select. Is that on the horizon?
LostKobrakai Posted March 29, 2015 Author Posted March 29, 2015 If you mean drag and drop, that's already implemented.
Peter Knight Posted March 29, 2015 Posted March 29, 2015 If you mean drag and drop, that's already implemented. Oh cool. I hadn't realised. Rushes off to check it....
Peter Knight Posted March 30, 2015 Posted March 30, 2015 The drag and drop reordering works lovely. Thanks for letting me know. Can I just chip in some thoughts? This is just a personal preference but I wonder if the selected items should matched the display of the normal Page Select results.IE stacked vertically with 100% width, trash icon and colored background. Then again, your way fits more selections into a smaller space.| I wonder if the drag and drop could be refined a little. When I drag a selected page left or right, I see a dotted line which I don't think is necessary. It's also only 70% height of the field too which makes it look like a mistake. It's probably a part of the original jQuery setup? Chrome has an annoying habit of trying to auto-fill the results and bringing up a selection of 'helpful' results. But really, thanks for taking time to make this. It's a really cool field and my users will love it.
Peter Knight Posted March 30, 2015 Posted March 30, 2015 One more thing. This may not be part of your Module but when I save a page with the Chosen Select field, I get some weird formatting. See top left of screen and specifically the UL ID of: <ul id="notices" class="ui-widget"> <li class="ui-state-highlight NoticeMessage ui-priority-secondary NoticeDebug"><a class="notice-remove" href="#"><i class="fa fa-times-circle"></i></a><i class="fa fa-gear"></i> Session: Change: Company_Selector_2</li> I think the width here needs to be 100% and not 100px? .ui-state-highlight.ui-state-highlight { top: 0; background: rgb(240,240,240); margin: 3px 5px 3px 0; padding: 0; border: 1px dotted gray; width: 100px; height: 19px; }
LostKobrakai Posted March 30, 2015 Author Posted March 30, 2015 This thing is supposed to be the ghost element while drag-and-droping a tag. Congrats jQuery UI... I'll see if I can namespace this thing somehow. Edit: it's fixed for the dev branch. Will push it to master as soon as I've included a defaultAdminTheme.css as well. 1
Nico Knoll Posted April 5, 2015 Posted April 5, 2015 Is it possible to allow users to add pages by typing in something but still only show the same pages as before in the drop down? For example I have "foo" and "bar" as pages which get shown in the dropdown. Now user1 types "lorem". So a page called "lorem" get created. Now user1 creates a new page. The drop down should only show "foo" and "bar" and NOT "lorem". Maybe if "lorem" would be "hidden" the drop down could exclude it... Could you add this as an option? Like: "make auto-created pages hidden to prevent them from appearing in the list"?
LostKobrakai Posted April 5, 2015 Author Posted April 5, 2015 While the new page is in the dropdown it should be grayed out and unselectable as it's already selected. So what's the problem with showing it? I don't think there's an easy option to to hide them as the chosen library is automatically build from a multiselect input which does not have any modifiers. I've tried to add destinct styling to new pages before and found no good way to do this.
Nico Knoll Posted April 5, 2015 Posted April 5, 2015 What I want to archive is that you have like ten constant suggestions but still can add your own tags which should be saved but not appear in the drop down list. Maybe I have to change it a little than :/ Or is there another way to archive that?
LostKobrakai Posted April 5, 2015 Author Posted April 5, 2015 Maybe the easiest way to solve this would be with some custom js logic, as your subselection needs to be in another selectfield as your saved values (which include added pages). Otherwise I'd look into other libraries as chosen is really trying to act like real selectfields.
LostKobrakai Posted April 29, 2015 Author Posted April 29, 2015 Made a small update so that InputfieldChosenSelectMultiple now respects the "Allow pages to be added" setting. Without it one cannot add tags anymore. 3
LostKobrakai Posted May 11, 2015 Author Posted May 11, 2015 Pushed a small bugfix and added 2.6 compatibility.
kixe Posted May 27, 2015 Posted May 27, 2015 Thanks for this great module. It works perfectly together with my FieldtypeSelectExtOption.I use it also with new Core Module Options. Is there any chance to provide the ability to add options via the Inputfield, like adding pages if used together with FieldtypePage? I know it is more on Ryans side to provide this in his Module. Maybe there is a possibility of an approach from your side too?
LostKobrakai Posted May 27, 2015 Author Posted May 27, 2015 Feel free to support my request for it here: https://github.com/ryancramerdesign/ProcessWire/issues/932. I could try to implement this in the module, but I'd rather not do it. If Ryan implements it, then other inputfields can be compatible, too. 1
kixe Posted May 27, 2015 Posted May 27, 2015 Exactly what I am looking for. Since new page will be created by method renderAddable() in class InputfieldPage and not in FieldtypePage it would be maybe more on the Inputfield side to offer this feature. Especially in case of InputfieldChosenSelect it would be great to have it.
wilsea Posted November 13, 2015 Posted November 13, 2015 I'm probably overlooking something basic but I can't get this to work. I've located the plugin in the modules directory - installed it on the modules page (no strikeout line any more through Input Chosen Select and Input Chosen Select Multiple). Then when I go to add a new field - but Input Chosen Multiple doesn't appear in the select box for field type. What am I missing? (ProcessWire 2.6.1) - jquery-1.10.2.min.js located in templates>scripts Thanks in advance (feeling very stupid)
LostKobrakai Posted November 13, 2015 Author Posted November 13, 2015 It should normally add itself in the list of usable page inputfields, but could you please take a look at the module configuration of InputfieldPage if those two are in the list or not.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now