juek / CustomSections

Developer plugin for rapid prototyping of custom section types in Typesetter CMS
GNU General Public License v2.0
3 stars 7 forks source link

initial save when section is added #20

Closed juek closed 7 years ago

juek commented 7 years ago

When a new Custom Section is added and always_process_values = false, the section needs a initial edit in order to have a saved content. If the section is not edited (and thus not saved once) before logout, we will see the {{placeholders}} or other weird stuff, depending on the missing value processing.

This shouldn't be an issue normally because we can assume that every section will be edited. But there may be some 'use as is' sections that would need an initial save.

I'm wondering how to do this without a loaded editor instance. Any ideas?

a2exfr commented 7 years ago

Tool to regenerate stored section content on selected page`

I'd go for an additional cmd such as 'recreate_custom_sections' to be executed on a page.

We talk about some tools to recreate pages stored content, may this can be answer. Run this command manually or on section added. If section has "as is" purpose it must have all default values. Don't know why but I prefered manually command run, chek all defined custom section added hmm..( this to much compared to once press edit or recreate command ).

a2exfr commented 7 years ago

I'm gonna commit this command. So no need develop it.

a2exfr commented 7 years ago

Just merged. Fast testing goes ok. I leave to you beatify all it with some style, if you want and if you will be in the mood for this :)

juek commented 7 years ago

For beautification... I'm tempted to go PSR-2.

I personally do like more compact code better (with 2 blanks as indentation) and brackets on same line. I even don't care much about long lines (30 inch screen). But for readability and interaction, it's maybe the better route.

What do you think?

I'll check out your new additions shortly... be right back.

a2exfr commented 7 years ago

Ups, beautification I mean some css style for button and admin page))

personally I always use K&R style.