Support

Account

Home Forums Feature Requests Need a better way to organize fields! Reply To: Need a better way to organize fields!

  • The image here uses a random glyph icon set, AmandaB’s field layout and a Bootstrap popover. This is by no means the best solution, it’s just an idea!

    Visualization suggestion: when fields are hovered on, a small arrow icon might appear in the corner. On clicking this icon, a menu could be displayed with field-specific layout options.

    After the “Expand Field” or “Contract Field” link is clicked, the field wrapper could have its column width class adjusted to the next closest division – if we were using a 12-col class-based grid system, a field with class="field six columns" might instead become class="field seven columns" on click. This might be a bit easier on the Javascript/English translation if a more custom integer-based system was used, for example: class="field col6 columns"… this would allow for JS string split and integer manipulation, which is a bit less tedious 🙂

    Clearly this is only display-side, I imagine that admins would like the ability to specify layout options like this from the field edit page at /wp-admin/edit.php?post_type=acf as well.

    Data submission could either be AJAX on popover link click, or it could be submitted on post update like normal – the latter may be better in case users change layout and decide to refresh the page in order to revert changes.

    I suppose this means adding more data for each field – ACF will need to keep track of each field’s layout settings behind the scenes. I’m not sure where exactly this data should be placed however… it’s not particularly useful in the theme-side get_field() calls, so in the interest of efficiency it might be better to only have this info available in the administration pages.

    The downside of the display-side layout adjustment is that it will need to be role-restricted. We won’t want everybody to be changing field layouts on a whim! I’m not sure what capability level is required to add/edit ACF fields, but I would assume that it’s manage_options – the same capability level could be used to determine whether a user has the ability to adjust field layout on the fly.

    Thoughts?