Form layout for inputting data

1 reply [Last post]
ken
Offline
Last seen: 10 years 24 weeks ago
Joined: 2011-06-22

Hi Chris,

Many thanks for the terrific video series on Drupal 7 - your excellent videos are simply the best source of training and information on Drupal in existence!

I have a question concerning form layout for inputting data into Drupal. For output, modules such as Views and Display Suite are fantastic, but what about input? If I have forms or nodes that have numerous fields, what is the best approach to arranging these fields for the editing mode? Do I have to manually create templates for this mode or are there modules out there that will assist in this task? Not sure what the best practices would be, so any suggestions would be most welcome - or of course, a video on this topic :)

Thanks,

Ken

Chris Shattuck
Offline
Last seen: 10 weeks 4 days ago
Joined: 2009-08-16
Hi Ken! This is a great

Hi Ken!

This is a great question, and one that I've gotten a few times. As far as I know (but I'd love to hear if other folks have heard of something) there's not a module specifically geared toward modifying form layout, though I could see that being an interesting project since it's kind of a bugger getting a form to look just right.

There are a lot of things you can do with CSS and simple markup within the form, using #prefix, #suffix and markup element types. If you're dealing with an existing form, you can get access to all of these things with hook_form_alter().

If you need to do more intense manipulation (like looping through inputs), then you'll probably use a form's theme function to do the work. You can then render specific inputs within easier-to-manipulate blocks of HTML, rather than fragmented HTML that you'd put in #prefix and #suffix.

Let me know if that points you in the right direction.

Cheers!
Chris

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:


Loading...
Contact us

Below are the supported keyboard shortcuts for our video player.

space
Start / stop video
shift
Go to next video
shift
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
1...9
Jump to a percentage (2 is 20%, for example)
f
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
$29
1 month
$156
6 months
10% off
$276
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
user
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.