Forum

Thread tagged as: Suggestions

Field Groups - Suggestions for perch:group tag

I very much like the functionality of <perch:group >, thanks!
I have written a divider add-on which you hopefully made redundant now. So kudos!

I have five suggestions to improve (my) the functionality for <perch:group>. The first is about the state of the collapse, the second about the data displayed when collapsed. The third and fourth are about adding some visual hierarchy.

1. Collapse only if no fields are filled

<perch:group> has a nice 'collapse' attribute. I would like to see an extension to this: collapse = [ true | false | on-empty ] Collapse on-empty: Only collapse this group if there is no data in it.

Usage situation
The user only wants to see important data. The rest of the data can be 'hidden' in a group - until use. Using the fields in a group is the same as filling the fields with data. Hence the 'on-empty' state.

This to me seems more user-centered than remembering the state of every collapsed or not-collapsed group.

Collapsed but filled
In the situation that sometimes data can be 'not important' but filled. If this is true for all of the users, the Perch template builder can set collapse='true'.

Remark about this request
I was going to add this to my auto-collapseable-dividers code on Github. But hopefully the <perch:group> will make this redundant.

Oh.. and I tried using <if exists='fieldname'> around the <perch:group> tag. But that didn't work :) I already expected that, but couldn't resist trying.

2. Displayed data on collapse

I love the way the data is displayed when collapsed!!
I run into some small user-interface issues in combination with <perch:repeater> items though.
a. There is a lot of data shown on screen that is not relevant: the group is collapsed for a reason.
b. There is no visual divider between the items in the repeater.
c. There is a double collapse

**Request per issue **
a. Could you add an extra fields attribute, so I can select the fields to be displayed in the collapsed state?
b. I don't mind if the fields are comma separated. I looks nice now, but comma separated is more space-efficient with repeater I find. Then every new item in the repeater can have a newline and a bold fieldname.
c. maybe combine the collapse: When 'opening' the collapsed group, also open every collapsed repeater inside.

3. Extra visual hierarchy

I would like to see the hierarchy more emphasized. For example - Add some size to the h2.divider itemname of every item. - shift the perch:group a bit to the right with a small margin-left

I could (and have done) this by altering my /addons/plugins/ui/admin.css. But to make this a bit easier and more robust, I have suggestion 4:

4. Uniquely target the item's title

In the admin screens I would like to be able to more uniquely target the title of an item with CSS. Could you maybe add an extra class to the h2.divider of the item? Something like add an 'item-title' class: <h2 class="divider item-title"> instead of the generic <h2 class="divider">

While I can (now, in this situation with only groups) change the CSS for it in this situation, it seems more robust to be able to target the itemname 's appearance. This is the path to the h2 in html in case its not clear what I mean: #main-panel .items .edititem h2.divider

5. Make the SVG arrow clickable

Unlike the other arrow-collapse situations in Perch, the one from the <perch:group> is not clickable (in my case).
Unlike the collapse for the <perch:repeater> there is a hand-icon (cc cursor:pointer) on the title of the group. Maybe add this also to <perch:repeater> ?

Hopefully you see some sense in these suggestions.
Thanks,
René

René Banus

René Banus 0 points

  • 3 years ago