Jump to content

PageTable - Use Template's Labels (always)

Recommended Posts

it turns out that if you create a PageTable field and assign only one (1) template you get a 'add new' button. it does NOT use the label from that template.  but when you assign two (2) or more templates the system will use the template labels to lable the buttons.

i feel it should use the template label for the button even if one template is assigned.

this topic came up in the general support area, here.

Link to comment
Share on other sites

I would say that no need for setting. PageTable is not the easiest one to configure, so let's not make it any more difficult :) Both are fine solutions, using just "add new" goes well with pw convention used in other places, but it makes it more difficult for new developers to find out that there could be more options. 

So my vote for "convention over configuration" here. Might be also that I have never figured this could be a problem. I understand that using general "Add new" made it more difficult for Chris to find out that there can be more templates even on basic PageTable, but what kind of situations you have had Teppo? Have those been purely usability preferences?

Link to comment
Share on other sites

... but what kind of situations you have had Teppo? Have those been purely usability preferences?

One particular case I had to deal with recently was using PageTable for configurable page layouts, i.e. dropping in blocks/widgets. In most cases, there were many different block types, but in some cases only one. In this case, I would've preferred to use template labels consistently, not making the client guess what this "new" block is that will be added. Could've solved this by field naming or descriptions, but this particular implementation was supposed to be as dynamic (and consistent) as possible, hence the need for "action" buttons to behave same way everywhere, regardless of field settings.

Generally speaking convention over configuration is fine by me, but in my opinion current behaviour is far from "obvious". It's consistent with some other features in ProcessWire, but not consistent in the scope of PageTable itself. Additionally PageTable is one of those parts in ProcessWire where "convention over configuration" might not be the best approach after all; it's already being used for a lot of different purposes, and while that's a strength (no doubt about that), it does boost the importance of being configurable.

In fact I've meant to post some additional suggestions related to labels, per-template settings, modal/view settings, and such; still trying to figure out whether to do that or simply fork PageTable. PageTableExtended is not exactly what I'm looking for either, even if it does already do some of the things I've had in mind. Anyway, that's a subject for another discussion :)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...