Jump to content


Photo

Module: TextboxList

Module

  • Please log in to reply
20 replies to this topic

#1 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 26 December 2011 - 03:35 PM

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

Attached Thumbnails

  • Bildschirmfoto 2011-12-26 um 21.43.44.png


#2 apeisa

apeisa

    Hero Member

  • Moderators
  • 3,156 posts
  • 1707

  • LocationVihti, Finland

Posted 26 December 2011 - 04:12 PM

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.

#3 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 26 December 2011 - 04:12 PM

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 :)

#4 Pete

Pete

    Forum Admin

  • Administrators
  • 2,422 posts
  • 1455

  • LocationChester, England

Posted 26 December 2011 - 05:31 PM

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?

#5 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 26 December 2011 - 05:33 PM

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)

#6 ryan

ryan

    Reiska

  • Administrators
  • 7,797 posts
  • 6573

  • LocationAtlanta, GA

Posted 26 December 2011 - 09:29 PM

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.

#7 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 26 December 2011 - 09:53 PM

OK, changed it :)

#8 Pete

Pete

    Forum Admin

  • Administrators
  • 2,422 posts
  • 1455

  • LocationChester, England

Posted 27 December 2011 - 04:05 AM

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.

#9 Oliver

Oliver

    Sr. Member

  • Members
  • PipPipPipPip
  • 134 posts
  • 27

  • LocationBasel, Switzerland

Posted 27 December 2011 - 07:14 AM

Love it, Nico! Really nice! Can’t wait to try it.

#10 apeisa

apeisa

    Hero Member

  • Moderators
  • 3,156 posts
  • 1707

  • LocationVihti, Finland

Posted 27 December 2011 - 07:32 AM

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).

#11 ryan

ryan

    Reiska

  • Administrators
  • 7,797 posts
  • 6573

  • LocationAtlanta, GA

Posted 27 December 2011 - 12:11 PM

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.

#12 jan

jan

    Jr. Member

  • Members
  • PipPip
  • 29 posts
  • 8

Posted 17 April 2012 - 04:10 AM

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?

#13 ryan

ryan

    Reiska

  • Administrators
  • 7,797 posts
  • 6573

  • LocationAtlanta, GA

Posted 17 April 2012 - 09:01 AM

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.

#14 netcarver

netcarver

    Hero Member

  • Members
  • PipPipPipPipPip
  • 542 posts
  • 508

  • LocationUK

Posted 23 October 2012 - 10:13 AM

Nico, any plans to add this to the modules directory -- or have I just missed it in there totally?
Steve ☧

#15 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 23 October 2012 - 11:00 AM

Should be there already... but looks like I forgot to add it... I will do this as soon as possible.

#16 adrian

adrian

    Hero Member

  • Members
  • PipPipPipPipPip
  • 1,462 posts
  • 1195

  • LocationCanada

Posted 08 April 2013 - 07:47 PM

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.



#17 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 09 April 2013 - 10:26 AM

Maybe a bit more details about what "crashed my site completly" means would be helpful :)



#18 adrian

adrian

    Hero Member

  • Members
  • PipPipPipPipPip
  • 1,462 posts
  • 1195

  • LocationCanada

Posted 09 April 2013 - 11:43 AM

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.



#19 Nico Knoll

Nico Knoll

    The Boss.

  • Members
  • PipPipPipPipPip
  • 811 posts
  • 402

  • LocationBerlin, Germany

Posted 09 April 2013 - 02:09 PM

Okay, glad to see it's working for you!



#20 apeisa

apeisa

    Hero Member

  • Moderators
  • 3,156 posts
  • 1707

  • LocationVihti, Finland

Posted 09 April 2013 - 02:18 PM

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.







Also tagged with one or more of these keywords: Module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users