hofff / contao-calendarfield

GNU Lesser General Public License v3.0
18 stars 3 forks source link

FR: no default Theme Setting #43

Closed t-muir closed 3 years ago

t-muir commented 6 years ago

Although it's nice to have a range of themes to select from and use as a base to get started, I would find it more practical to have no theme (or an extremely minimal base theme) selected.

In practical use cases the styling of the datepicker has to be adjusted to suit the theme of the website it is in. One would then like to rely on the datepicker loading the customised styling by default.

One can reset the globals, of course but it would be a nice enhancement if one didn't have to.

cliffparnitzky commented 6 years ago

Sorry, I don't understand. You can deselect "Use CSS" an then you don't have any styling. Or you select "Use CSS" and select no "jQuery UI Theme". Then you have the minimalistic CSS provided by the jQuery datepaicker plugin.

t-muir commented 6 years ago

Absolutely. But if you are building this for a customer where the editors (should) have limited editing rights, then it is better if the it defaults to the styled theme (and not the extensions default theme).

Or in other words - content editors should not be allowed to make decisions about styling but at the moment they are forced to (or have to be instructed to )choose the "correct" theme.

cliffparnitzky commented 6 years ago

Ok. I understand. I think this is a general probleme with Contao components: "how to define defaults for fields, the editor is not allowed to edit". I think the most common und best way is setting the default via GLOBALS.

What do you think @frontendschlampe ?

frontendschlampe commented 6 years ago

I understand the problem and I agree with @t-muir

@cliffparnitzky Your solution would be, to make a default setting in the settings of Contao, right?

cliffparnitzky commented 6 years ago

No, that's not my suggestions! I think the best way is defining the default value via dcaconfig.php ($GLOBALS['TL_DCA']['tl_form_field']['fields']['dateIncludeCSSTheme']['default']).

t-muir commented 6 years ago

@cliffparnitzky - this is what we've done (or at least similar - in Contao 4 it's in the app/Resources/dca folder )

Setting defaults that way does entail a little more advanced knowledge - not so suited for some contao users. I think the extension is otherwise really good and easy to use and if the default theme were simply a very plain and simplified version - something the themers can build there custom styles on, this would be improved. At the same time I don't regard this as critical.

(ok - if I find the time, I'll see if I can put together a minimal theme proposal ;-) )

frontendschlampe commented 6 years ago

No, that's not my suggestions! I think the best way is defining the default value via dcaconfig.php ($GLOBALS['TL_DCA']['tl_form_field']['fields']['dateIncludeCSSTheme']['default']).

Hmmm ... I think, it's one way, but not the best! ;-)

The best way would be if I had the setting in the page structure. So I don't have to create a dcaconfig.php and I can define the default setting per startpoint. ;-)

cliffparnitzky commented 6 years ago

Sounds good, but I think the better place is the theme, isn't it? It's all about the representation (design) ... and that's definded in the themes.

frontendschlampe commented 6 years ago

hmmm ... I think the theme is not the right place, because I can have one theme but various layouts with various designs. So maybe layouts?!

t-muir commented 6 years ago

Good point ⬆️ - I'd see it in the theme settings rather than the layouts. I presume one would only alter the design of the datepicker once, per Theme.

cliffparnitzky commented 3 years ago

Due to the change to flatpickr with version 4.0.0 this not longer relevant.