Problem/Motivation

This issue is a Feature Request related with the Bug report #1344846, I'll try to summarize it.

When we have a page for editing a node, we display each form's fields in our panel as we like. Then there is a plugin named "General form" (Add content > Form > General form), which will display the rest of elements necessary for this form to work.

What if someone just want to show a couple of fields for edition and hide the rest of the form? Some of us, just skip the "General form" block. But this is not secure neither recommended, as it was pointed out in the related Bug report (see first paragraph). So there isn't really an easy/documented way of skipping fields of the form.

The feature request I'm asking now, is a way of doing this within Panels.

Proposed resolution

I can give a generic idea to get this done, not sure if it is reasonable and the best way:
When configuring the "Generic form", there could be a setting like "Hide these fields". Then, instead of displaying these fields when rendering the form, each of these fields would be declared as having ['#access'] = FALSE.

Comments

merlinofchaos’s picture

Right now, you'd have to form alter it.

Because there is very little information available about what a form will actually contain, it's very difficult to put something into the UI. So while this would be a really nice feature, it's not one that's really easy to implement. Any implementation might end up looking like a weak form alter, and still require you to know the exact keys and be pretty flimsy and unsatisfying.

So ultimately it may be best to just use hook_form_alter. With form_alter you can do this:

$form['field_foo']['#access'] = FALSE

Then the field will become hidden.

Letharion’s picture

Status: Active » Postponed

Moving this to the postponed queue, and anyone with an interest in working on this can re-open it as necessary.

Letharion’s picture

Issue summary: View changes

Use of summary standards by hiphip

japerry’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.