Drupal Form Layouts with Renderable Elements

flickr 279354231 hd

Drupal Form Layouts with Renderable Elements

Anyone who has ever needed to alter a node form knows how difficult it can be to get it to cooperate. However, paired with Display Suite and Field Group, Renderable Entities gives users the ability to format the display of just about any form built using the Form API, including node forms. This is nice because it adds all of the standard Drupal fields and module fields like the published checkbox, URL alias settings and allows you to rearrange them just as you would on the "manage display" screen of a node. Along with field group, it will also place all of the fields into their corresponding field groups.

  1. Install the module and its dependencies.
  2. Enable the following modules:
    • Display Suite
    • Display Suite Forms
    • Display Suite Extras
    • Field Group
    • Renderable Elements
  3. Set the Renderable Elements settings by going to the settings page at admin/structure/rel/config and making sure the "Enable form registration" checkbox is checked.
  4. Now go to the "Manage fields" form of one of your content types.
  5. Click on "Manage form display" at the top of the page to register the form with Renderable Elements to select which fields to enable. Upon saving this form you will be able to manage the display of ALL fields on your content type using the standard Display Suite UI.

Some caveats to look out for:

  1. The Renderable Elements module already makes note that you may have trouble with some form elements, particularly ones that are being modified by other modules.
  2. You'll want to enable the Display Suite Hidden region under the display suite settings if you're attempting to remove or hide fields on a node form. Otherwise you may run into issues when saving nodes.
  3. We ran into some issues trying to use custom display suite layouts.
  4. Renderable elements is still just an alpha release and may have some other unforeseen issues, use at your own risk. 

Did you find this post helpful? Let us know in the comments! 

 

Featured Image Credit: Gábor Hojtsy

Related Posts

OE Pro: Creating Custom Content Layouts With Drupal 7

Brent Bice
Read more

Track Contact Form 7 with Google Analytics Goals the Easy Way

Tom McCracken
Read more

5 Must Have Landing Page Elements

Felipa Villegas
Read more

5 Most Important Elements of a Law Firm Website

JJ Lonsdale
Read more

Meetup Alert! We're hosting "Building Next Generation Web Apps with Angular.js and Form.io"

Kyle Taylor
Read more

5 Trending Elements in Healthcare Websites

Felipa Villegas
Read more