Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-01-14 03:45:18

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Required fields on Sections pane

following this checkin.

On the sections page > new section, the “page” and “style” entries are now required and are pref-filled by default with the default page and style (that was already the case before). OK, I guess that makes sense. Especially as those are required.

However, the select widget for both (still) has a blank option at the top. I could see a point in that – if the entry is not required – as the user could decide to create the section now, and fill in the details later when “page” and “style” are set up.

That is now more of a nuisance and confusing than anything. Selecting a blank field triggers the browser validation for required fields.

Edit: screenshot, in case needed

Last edited by phiw13 (2020-01-14 08:15:34)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2020-01-14 09:09:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Required fields on Sections pane

If they’re required we need to remove the blanks (and probably from the multi-edit too). Originally, the blank entries were for “leave as it was” but that causes issues if you change theme. See issue 1456.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#3 2020-01-14 09:10:41

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Required fields on Sections pane

The (invalid) blank option is there to indicate that some assigned asset (page, style) from the current theme is missing in the new theme when you switch them. Otherwise txp would just choose for you the first available asset without warning.

I guess adding some ‘Please select’ text for the blank option would make things clearer.

Offline

#4 2020-01-14 09:16:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Required fields on Sections pane

Ah yes, that makes sense. Let’s leave the blanks in that case and see if we have a string for “Select…” (or similar) knocking around. If not we should probably add one.

Edit, presumably we can add this to selectList() when using the blank_first parameter without breaking anything?

Last edited by Bloke (2020-01-14 09:18:46)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#5 2020-01-14 11:22:43

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Required fields on Sections pane

etc wrote #321078:

The (invalid) blank option is there to indicate that some assigned asset (page, style) from the current theme is missing in the new theme when you switch them. Otherwise txp would just choose for you the first available asset without warning.

I guess adding some ‘Please select’ text for the blank option would make things clearer.

Hmm, ok. A ‘Please select’ would make things certainly less confusing.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2020-01-14 11:42:35

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Required fields on Sections pane

Bloke wrote #321081:

presumably we can add this to selectList() when using the blank_first parameter without breaking anything?

That’s what I thought, but it looks like all options are added (and pre-selected) via JS, dunno where.

phiw13 wrote #321086:

A ‘Please select’ would make things certainly less confusing.

Actually, style could be optional?

Offline

#7 2020-01-14 11:57:39

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Required fields on Sections pane

etc wrote #321087:

Actually, style could be optional?

From my POV yes, certainly. What the internal mechanics of TXP say, that you know better that me

I actually never really used the styles panel, there only is a comment in the default stylesheet reading: unused!


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#8 2020-01-14 12:20:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Required fields on Sections pane

etc wrote #321087:

That’s what I thought, but it looks like all options are added (and pre-selected) via JS, dunno where.

Drat, yeah. Forgot that the panel has to populate the dropdowns on demand when you change the theme. See function section_theme_show(skin) in textpattern.js.

Actually, style could be optional?

As long as it doesn’t leave anything orphaned if a theme is deleted, if there’s a way we can be clever about all this reassignment (like, maybe, if the newly selected theme shares an asset name with the one that is currently in force, perhaps pre-select those assets, otherwise set it to the first empty/please choose option?) then sure.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#9 2020-01-14 12:36:49

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Required fields on Sections pane

Bloke wrote #321090:

As long as it doesn’t leave anything orphaned if a theme is deleted, if there’s a way we can be clever about all this reassignment (like, maybe, if the newly selected theme shares an asset name with the one that is currently in force, perhaps pre-select those assets, otherwise set it to the first empty/please choose option?) then sure.

As I get it, in dev

  • you can not delete an in-use (live or dev) theme.
  • when the newly selected theme has the current assets, they are pre-selected when switching themes. Otherwise the ‘blank’ asset is pre-selected.
  • quickly tested empty css for a section, it does not seem to break anything. If used, <txp:css /> selects default style in this case.
  • actually, empty page just yields ‘unknown section’ without further harm (save for admin UX quirks that I will fix).

So I would suggest that we leave page and css optional, removing the corresponding sections and their articles from <txp:article(_custom) /> and <txp:section_list /> (currently testing).

Offline

#10 2020-01-14 13:14:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Required fields on Sections pane

That approach works for me!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#11 2020-01-14 15:03:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Required fields on Sections pane

etc wrote #321087:

Actually, style could be optional?

With the recent functionalities which allow a section to be used for an xml sitemap, and other purposes, I think that attaching a style should be optional.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#12 2020-01-14 22:45:08

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Required fields on Sections pane

colak wrote #321096:

With the recent functionalities which allow a section to be used for an xml sitemap, and other purposes, I think that attaching a style should be optional.

Yeah, good point, it is confusing as well.

–~–~–

Oleg, your latest patch seems to do what you describe above (light testing so far). And now that empty entry in the select on the Edit panel does make sense again. TY.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB