Robin S

Minimal Fieldset

Recommended Posts

Minimal Fieldset

Adds a config option to Fieldset/FieldsetGroup/FieldsetPage to render the fieldset without label or padding in Page Edit. When a neighbouring field in the same row is taller than the fieldset the extra height is distributed evenly among rows within the fieldset.

Requires ProcessWire v3 and AdminThemeUikit.

Why?

This module allows you to create layouts in Page Edit that would not be possible without it. It's useful when you want a layout that has two or more fields as rows that are themselves within a row in Page Edit.

It's also useful when you have some fields that you want to add to a template as a group (i.e. via FieldsetGroup or FieldsetPage) but having a heading and visible wrapper for the fieldset in Page Edit would be redundant.

Example:

template-fields

page-edit

Installation

Install the Minimal Fieldset module.

Usage

In the field settings for any Fieldset/FieldsetGroup/FieldsetPage, tick the "Remove label and padding for this fieldset" checkbox.

 

https://github.com/Toutouwai/MinimalFieldset
https://modules.processwire.com/modules/minimal-fieldset/

  • Like 22

Share this post


Link to post
Share on other sites

very nice! 😍

  • Like 1

Share this post


Link to post
Share on other sites

This is really great. In order to make editing easy for users I spend a lot of time grouping and arranging fields in the backend. I definitely will use it!

Share this post


Link to post
Share on other sites

Thanks! Really nice.

Share this post


Link to post
Share on other sites
11 hours ago, Robin S said:

Requires ProcessWire v3 and AdminThemeUikit.

I was happy too early... AdminThemeUikit required. I am still a Renoman...

Share this post


Link to post
Share on other sites
12 hours ago, Klenkes said:

I am still a Renoman

Upgrade then 🙂

Share this post


Link to post
Share on other sites

Wonderful! Well done and thank you for taking the time and releasing this. I've been thinking about the exact same thing for a while now.

Could you make the vertical spacing optional, via another checkbox maybe? I have quite a few layouts where the secondary column has a lot fewer inputs and would prefer to have them on top.

Share this post


Link to post
Share on other sites
2 hours ago, d'Hinnisdaël said:

Well done and thank you for taking the time and releasing this.

Glad you like it. 🙂

2 hours ago, d'Hinnisdaël said:

Could you make the vertical spacing optional, via another checkbox maybe?

Done, in v0.1.1.

  • Like 3

Share this post


Link to post
Share on other sites

Thanks for the module. Maybe this could be in the core... Any chance of supporting AdminThemeDefault? If not, then you could possibly check if the user has Uikit theme active before injecting css file and applying classes?

  • Like 2

Share this post


Link to post
Share on other sites
34 minutes ago, matjazp said:

Any chance of supporting AdminThemeDefault?

No, AdminThemeDefault and AdminThemeReno do some crazy JS spacer stuff to equalise field heights. This module relies on the flex layout used in AdminThemeUikit.

 

34 minutes ago, matjazp said:

If not, then you could possibly check if the user has Uikit theme active before injecting css file and applying classes?

Possibly, but not sure what the point of that would be. The module already requires AdminThemeUikit in order to be installed and also clearly states that in the readme. And if you have AdminThemeUikit installed but you allow some users to choose a different theme then using this module is not going to be a good idea. Best just not to install it in that case.

  • Like 1

Share this post


Link to post
Share on other sites

In v0.1.2 I've added some warning notices in case AdminThemeUikit is installed but not in use.

Share this post


Link to post
Share on other sites

Field exports don't seem to work properly with the module enabled. When exporting a Fieldset (via Setup » Fields » Export), I get the following error: Call to a member function add() on null (MinimalFieldset.module, line 74). $wrapper seems to be unset in this specific context.

Uninstalling the module gets rid of the exception. Could you check if you see the same thing (I'm on 3.0.117) or if I just have something misconfigured?

  • Like 2

Share this post


Link to post
Share on other sites

I installed the module (v0.1.3) on an existing site, running PW in the current Master release, v3.0.98 on Php 7.2.
After enabling the module for a regular Fieldset (Open) I kept running into this error:

Method InputfieldFieldsetOpen::wrapClass does not exist or is not callable in this context

This is because Inputfield::wrapClass() has not been added to the Master yet, it is only available on the ProcessWire dev release (currently 3.0.119).

The fix for this issue is to replace lines 107-109 with:

// Add classes to inputfield
$inputfield->wrapClass .= ' MinimalFieldset';
if(!$field->no_spacing) $inputfield->wrapClass .= ' MinimalFieldsetSpaced';

 

  • Like 2

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.