Open septor opened 8 years ago
Personally I doubt that this is a plugin which will be used by many plugins (let alone in core).
I feel that it should therefore not be included in core but instead up to the plugin developers to implement it into their own plugin, which should be easy (if not, then THAT is what needs to change :)
I personally have 2 plugins that could benefit from this right now, and a few that I have planned that would benefit from it. I can think of instances where it would come in handy for theme developers as well. Example:
You create a theme with customizable elements, which would (maybe?) require you to create a plugin as well that allows the user to pick the colors they want to use. Maybe you want to limit them to Bootstrap colors (success, danger, warning). How amazing would it be if you could allow them to just pick whatever colors they want without having to leave the area?
For now, a textbox works where users just enter the hexcodes, but that's not very user friendly and I can't see a point in including this into each of my plugins and having to worry about conflicts popping up because it's called 50 times.
Hmm, you've convinced me. Listed as enhancement :)
I'd normally agree that adding more bloat to the core is a bad idea, but I think this is a broad enough thing that more than just the 6 people that use my plugins will get benefit out of it.
Not only is it broad enough but also look at other CMS's out, most popular one is WordPress and they have a method to edit the theme without editing the core files, and not only that but plugins that can even enhance that - to add more customization to the theme.
You take Simple Forum Machine - they have it so you can edit the theme files threw the admin area and have a screen (iframe) up top so you can see your changes live.
However this could be a simple easy plugin with a theme that allows that type of customization to be done and look for values for the theme through site pref's.
if it's optional.. yeah.. could come in handy. but please keep it optional. maybe create a plugin for this?
There are great functionalities already present for theme options/customisation. Unfortunately they are not used at the moment in any theme, nor are they documented.
I'm working on a theme which uses these functionalities.
cool. keep us posted. (Y)
Firstly, I think this is going in a tangent. I'm not concerned about the complexity of theme creation. I used it as an example to point out the broadness and usefulness of this request.
@willem010 An optional form type? Aren't they all? I think you misunderstand what I'm asking for.
You can allow people to enter a date in a textbox, or you can use the datepicker. Both achieve the same thing but one allows the user an easier way to send the data.
This has no relevance to the end user (you). If you are using a plugin chances are the creator of a plugin gave you the option to use the datepicker over the textbox because it was easier. Plus, the data you can send is now limited to what the datepicker pushes and not what you could enter into a textbox.
A colorpicker form type would allow for me to ask you to enter a color you want something to be and you be able to select it from a dropdown component instead of researching a hexcode to enter. It requires no more effort on my part, and now makes using my plugin for you a lot easier.
@septor maybe i do get you wrong. All i'm trying to say is, there are a lots of scripts in a default install, half of which isn't really used. (i didnt check last version, so it might be better on later versions ;) ) this can be an issue on sites with huge numbers of visitors.. where every bit counts. i'm not against new functions. i just want to keep the option of a clean site without clutter. that's all.
Well all the css and js that is not used on a particular page, should not be called on that page. This counts for all added scripts such as the datepicker. Those should never be included by default on all pages but only there were necessary/used (e.g. $frm->datepicker).
If this does happen then it should be fixed.
The inclusion of a colorpicker won't affect your current e107 installation unless one of your current plugins, or a plugin you install in the future, utilizes the colorpicker.
It will only ever be called if it's requested. As @Moc said, things should only be called if they are needed.
@septor, can't you just include the js and css in your plugin and then use the input ID as the selector? (datestamps are used extensively throughout the core, color selection not at all, unless I've forgotten something).
@CaMer0n Sorry it took so long to reply, I forgot about this!
Yeah, I could. But for reasons mentioned above I don't see the point in adding it to each plugin I want to use it on. It could cause conflicts or make me have to work harder to check if it's already loaded.
I think I'm going to just throw together a quick plugin that loads the required file, then just add an if/else clause to my stuff and if said plugin is installed utilize the colorpicker otherwise use a textbox. Anyone interested in this can follow the progress here: https://github.com/septor/bootstrap-colorpicker
I'm going to close this since it's probably not going to make it into the core!
Well, (in my opinion) the best solution would be if it were possible to define new field types by third-party plugins, then these field types were available from the core e107::getForm(). So, in my opinion, e107 should provide a solution for the expansion of the methods in e_form class, e.g. with addon file (e_fields or e_form).
@CaMer0n This would be feasible?
I also personally agree that the colorpicker should be a core field option, for admin ui, since i'm currently having a hard time on making on work on the admin menu manager ui.... Right now the admin fields are too much "rigid", and lacking flexibility, something the old one was...
type=method should provide all the flexibility you would need to make this work.
We have a datepicker (that works basically as well as I do). Why not a color picker too?
Here's one that looks pretty swell: https://github.com/mjolnic/bootstrap-colorpicker/
xoxo