These are chat archives for cakemanager/cakeadmin-lightstrap

3rd
Jul 2015
Bob Mulder
@bobmulder
Jul 03 2015 08:08

Hey @leoruhland,

First of all, you've done great commits! I think the feature adds something to the theme. On the other side we have some things do discuss ;) But keep in mind I really appreciate your work ;).

I've found the following in the CookBook: http://book.cakephp.org/3.0/en/views/helpers/form.html#adding-custom-widgets. This would make it better to add custom types, instead of your switch-case you have now...

At the moment it's possible to add a type named ls-name. But what if an user decides to use the theme HeavyStrap? He has to change all his ls-name to hs-name and needs even to change the types in all the plugins he uses... So what do you think about the following:

  • ls-select - Will be default used when it's a select-box.
  • ls-editor - Will be default used when it's a textarea.
  • ls-date - Will be default used when it's a dateTime-input.
  • ls-color - Will be used when the class colorpicker is added.
  • ls-toggle - Will be default used when it's a checkbox or something?
  • ls-number Will be default used when the input is an integer.

What do you think about this? When using it this way, it's easier for other themes and people to customize, and that's what we want ;).

An option could be that we will define some extra inputs in the CakeAdmin plugin (about that widgets I talked about above), and themes are able to design that widgets ;).

Please let me know what you think about it ;)

Greetz

Leonardo Ruhland
@leoruhland
Jul 03 2015 10:15
Hi! I agree that widgets is the best solution for fieldtypes.
I just reused some cakephp2 code to get working. I really need to learn how to apply that on widgets.
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:20
About replace default types, i dont think we should do it.
Bob Mulder
@bobmulder
Jul 03 2015 10:33
Okay tell me why :)
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:36
I think we shouldn't force any type. The cakephp types is already useful. Date, int, tinyint checkbox, selects.. The plugins should add a bĂ´nus types
Bob Mulder
@bobmulder
Jul 03 2015 10:39
I don't think that's right because you want to add a theme only for the design. When a specific plugin adds a postType it should be sure it uses the right type. ls-select is only for lightstrap but what happens if another theme is used?
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:45
I should separate all fieldtypes in another plugin? Because now you are required to use with LS. All external plugins used are bootstrap compatible and i dont know if really work without it.
We can rename types to plugin names.. My old helper works like that.
Bob Mulder
@bobmulder
Jul 03 2015 10:47
But am I right that when using lightstrap (for example) you always want to use select2 when you have a select type?
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:47
select2, summernote, colorpicker
I dont think so.
Maybe in some project you wanna use a new markdown editor and not summernote.
Or, not in whole project, but in some PostType only.
Bob Mulder
@bobmulder
Jul 03 2015 10:51
Yeah okay. But then, make it class specific (so when I add the class editor summernote will be added). This is because you want that an code-standard when you have multiple themes. All themes should work without extra code ;)
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:52
Right. I'll study widgets to perfectly implement that.
Bob Mulder
@bobmulder
Jul 03 2015 10:53
I think widgets shouldn't be needed anymore in that case? ;)
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:54
But I dont think that use the class is the best option to chose the type
I generate a unique field class to give the possibility to configure two instances of a plugins with different options.
In same form..
Bob Mulder
@bobmulder
Jul 03 2015 10:57
Example?
Leonardo Ruhland
@leoruhland
Jul 03 2015 10:59
Two datepickers, one for past date and one for future only..
Two editors, one of they we dont want to enable font changes..
The number spinner, with different max and step value
Bob Mulder
@bobmulder
Jul 03 2015 11:01
But when I have a textarea, i just should add the class editor and summernote could come in? ;)
Leonardo Ruhland
@leoruhland
Jul 03 2015 11:02
Yes.. But where do you set options for this instance of summernote?
All fieldtypes should be configurable
Bob Mulder
@bobmulder
Jul 03 2015 11:06
Ehm the themebuilder should do?
Because summernote is theme specific.
Leonardo Ruhland
@leoruhland
Jul 03 2015 11:07
Theme specific?
Bob Mulder
@bobmulder
Jul 03 2015 11:08
Yeah. The lightstrap theme uses summernote, but another theme could use ckeditor or whatever. So the user should not be interested in changing the summernote-setting. If you really want to you could create a setting via the settings-plugin. (summernote on or off)
Leonardo Ruhland
@leoruhland
Jul 03 2015 11:57
via settings?
Bob Mulder
@bobmulder
Jul 03 2015 11:58
Yeah but only the most important ones (so enable or disable summernote) but not specific settings because that's theme based
Leonardo Ruhland
@leoruhland
Jul 03 2015 11:58
but what about two instances of summernote with different options?
What the problem with changing type that bothers you?
Bob Mulder
@bobmulder
Jul 03 2015 12:00
We want to create multiple themes. The goal is that you could easily switch between themes. When creating a custom standard only for lightstrap other themes wont be compatible with that.
Leonardo Ruhland
@leoruhland
Jul 03 2015 12:01
really agree to exchange the names of types .. remove the prefix LS
and use the plugin name.. select2, bs-datepicker, summernote
we can detach the FormHelper
Bob Mulder
@bobmulder
Jul 03 2015 12:03
Select2 is a choice of the lightstrap theme. select is the type that should be used. Another theme could use another jquery-plugin... Same for summernote... summernote is a choise of the lightstrap theme. textarea is the type that should be used. Another theme could use ckeditor...
Leonardo Ruhland
@leoruhland
Jul 03 2015 12:04
No. Its not a choice of the theme.
Bob Mulder
@bobmulder
Jul 03 2015 12:04
Why not?
Leonardo Ruhland
@leoruhland
Jul 03 2015 12:04
You can reuse select2 or summernote in other themes
dont you?
Bob Mulder
@bobmulder
Jul 03 2015 12:05
Of course but another plugin can choose to use another plugin instead of select2 so the type select2 shouldnt be used...
Leonardo Ruhland
@leoruhland
Jul 03 2015 12:06
sure..
thats why we have to rename the field type to plugin names
and detach LightStrapFormHelper from theme
to reuse in any theme
what you think?
we can implement ckeditor type
and other plugins too.
Bob Mulder
@bobmulder
Jul 03 2015 12:07
implement in what? ;)
Leonardo Ruhland
@leoruhland
Jul 03 2015 12:08
add ckeditor to LightStrapFormHelper.. and rename this helper to FieldTypesFormHelper
Bob Mulder
@bobmulder
Jul 03 2015 12:09
Why? We chose for summernote ;)