Nico Knoll Posted December 26, 2011 Share Posted December 26, 2011 Hi, today I started and finished work on my new module "TextboxList". It includes "FieldtypeTextboxList" and "InputtypeTextboxList". The main function is to create inputfields like Facebook when you have to insert the name of your friend (see the screenshot below). It automatically creates a new "box" if you press "," or "enter". The result will be saved as a comma-separated list. It is based on the TextboxList.js of Guillermo Rauch so I wouldn't use this for a commercial project right now. (But I wrote him a mail if he would allow this). I changed the color schema so it looks like a native element. I recommend to use it if you have something like a tag list (like: bla, christmas, bla, 2011, bla, ...). You can download it here: https://github.com/N...oll/TextboxList Have fun with it! Greets, Nico 3 Link to comment Share on other sites More sharing options...
apeisa Posted December 26, 2011 Share Posted December 26, 2011 Looks great Nico! One question : does the fieldtype difference somehow from normal textfield? Just thinking if inputfield would be only thing required. Anyway, based on the screenshot this looks like a very useful module. Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 26, 2011 Author Share Posted December 26, 2011 Hmm, maybe you're right. I never created a Fieldtype/Inputfield before so I thought I have to create both But I think I need both... Nevertheless a new version is uploaded Link to comment Share on other sites More sharing options...
Pete Posted December 26, 2011 Share Posted December 26, 2011 Holy crap, this is great and would come in very handy for blogs (which I would guess is what you're using it on ) - does it have an auto-complete option like on Guillermo Rauch's site? Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 26, 2011 Author Share Posted December 26, 2011 No, because I don't know what you want to autocomplete (But maybe I'll add one later so that you can define some points in the "Details" page) Link to comment Share on other sites More sharing options...
ryan Posted December 27, 2011 Share Posted December 27, 2011 Looks great Nico, nice work! Seems quite useful now and lots of expansion potential too. My only suggestions would be to remove the 'permanent' from the getModuleInfo on the inputfield. And move the CSS/JS loaders from the fieldtype's sanitizeValue method to the inputfield's init() or render() method. Reason for this is that fieldtypes are supposed to be independent of interactive input, whereas that's what inputfields are for. Otherwise looks great. Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 27, 2011 Author Share Posted December 27, 2011 OK, changed it Link to comment Share on other sites More sharing options...
Pete Posted December 27, 2011 Share Posted December 27, 2011 No, because I don't know what you want to autocomplete (But maybe I'll add one later so that you can define some points in the "Details" page) I was thinking that if you have a "Tags" field then it will search all Tags fields on all pages where the field is used and suggest tags as you type as it does on some of the examples on his site. I know it's not particularly simple, but on a per-field basis where you would use this it would be neat to have the ability to tick a box to enable this as I can see places where it would be handy and places where you might not want it. In the tags example it might stop someone adding a tag that's spelled slightly differently by accident or something like that. That's not normally a problem with one author, but could be in a multi-author environment. Link to comment Share on other sites More sharing options...
Oliver Posted December 27, 2011 Share Posted December 27, 2011 Love it, Nico! Really nice! Can’t wait to try it. Link to comment Share on other sites More sharing options...
apeisa Posted December 27, 2011 Share Posted December 27, 2011 But I think I need both... I am pretty sure you only need inputfield at the moment. Unless you need different db schema, or different way to save and retrieve data from db you will be fine with normal textfield. Please correct my Ryan if I am telling lies here Not sure where you are heading with this, so it might be more convenient for you to keep it this way. Anyways, looking forward to using this - looks like a very useful module. Not sure if I would like to use this with tags, since I like my page references there (they allow easy renaming, removing etc if ever needed). Link to comment Share on other sites More sharing options...
ryan Posted December 27, 2011 Share Posted December 27, 2011 I agree this doesn't need the fieldtype at present since it could be designated as an input for the existing textarea. However, there's no harm in giving it it's own fieldtype. Some of the expansion potential may need it. Nico, if you want to make it PW 2.2 ready, look at the thread on module dependencies in the announcements board. The fieldtype+inputfield is a good 'requires' and 'installs' dependency to use with the new options. Though all are optional. Link to comment Share on other sites More sharing options...
jan Posted April 17, 2012 Share Posted April 17, 2012 Hi, unfortunatelly I've got a problem with the module. If I chose "TextboxList" for a field, there's no way to switch back to normal "TextArea". Is this because of the own fieldtype of TextboxList? Is there a way to tell the module what compatible fields are? In addition, I'd also try to make the InputField independent from the Fieldtype, but I'm not sure if I've got the skills yet... But perhaps with a little support, I can do it. I think a checkbox, to turn TextboxList als input on an off should be enough, right? Link to comment Share on other sites More sharing options...
ryan Posted April 17, 2012 Share Posted April 17, 2012 It looks to me like TextboxList's schema is compatible with the Text/Textarea fieldtypes, so the getCompatibleFieldtypes() function in it could be updated to contain this: public function ___getCompatibleFieldtypes(Field $field) { $fieldtypes = new Fieldtypes(); foreach($this->fuel('fieldtypes') as $fieldtype) { if($fieldtype instanceof FieldtypeText) $fieldtypes->add($fieldtype); } return $fieldtypes; } In addition, I'd also try to make the InputField independent from the Fieldtype, but I'm not sure if I've got the skills yet...But perhaps with a little support, I can do it. I think a checkbox, to turn TextboxList als input on an off should be enough, right? I can help you get started with this if you'd like. But need more detail. Link to comment Share on other sites More sharing options...
netcarver Posted October 23, 2012 Share Posted October 23, 2012 Nico, any plans to add this to the modules directory -- or have I just missed it in there totally? Link to comment Share on other sites More sharing options...
Nico Knoll Posted October 23, 2012 Author Share Posted October 23, 2012 Should be there already... but looks like I forgot to add it... I will do this as soon as possible. Link to comment Share on other sites More sharing options...
adrian Posted April 9, 2013 Share Posted April 9, 2013 Hey Nico, Module still doesn't seem to be in the directory. I tried a manual install, but it crashed my site completely - had to delete it to get things running again - might be something weird at my end, but might be worth checking out. Link to comment Share on other sites More sharing options...
Nico Knoll Posted April 9, 2013 Author Share Posted April 9, 2013 Maybe a bit more details about what "crashed my site completly" means would be helpful Link to comment Share on other sites More sharing options...
adrian Posted April 9, 2013 Share Posted April 9, 2013 Sorry, that was a bit lame wasn't it Basically I got a WSOD. I am really not sure what happened. I actually had the same issue with the thumbnail module. I just reinstalled yours and it is fine now. Seems like there is something weird on my server. All the other modules I have installed (either manually or through the modules manager) have been fine, but these two have required installing, deleting the folder, and then installing again to get them to work. I'll let you know if I ever figure it out. 1 Link to comment Share on other sites More sharing options...
Nico Knoll Posted April 9, 2013 Author Share Posted April 9, 2013 Okay, glad to see it's working for you! Link to comment Share on other sites More sharing options...
apeisa Posted April 9, 2013 Share Posted April 9, 2013 This module reminded me of Select2 - it's like asmSelect supercharged: textboxes like this, filters, custom labels, ajax etc That being said, it would be great to have Select2 as a Page field inputfield in PW. 4 Link to comment Share on other sites More sharing options...
adrian Posted April 9, 2013 Share Posted April 9, 2013 That would be an awesome addition to PW. I am tossing up the best field type for tags and I think that the multivalue option in Select2 type might actually be it Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 14, 2014 Author Share Posted June 14, 2014 Updated some stuff and added it to module directory: http://modules.processwire.com/modules/textbox-list/ 3 Link to comment Share on other sites More sharing options...
pwFoo Posted November 17, 2014 Share Posted November 17, 2014 Great module, but rather I looking for something like your module which deals with page references and supports autocomplete (other inputfield for Page Autocomplete core module, without jQuery UI dependency *g*). But really great for simple tag style values This module reminded me of Select2 - it's like asmSelect supercharged: textboxes like this, filters, custom labels, ajax etc That being said, it would be great to have Select2 as a Page field inputfield in PW. Yes, that would be awesome! 1 Link to comment Share on other sites More sharing options...
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