I'm wondering how to create a template for the input form I've made with cck. Specifically, I want the select lists to stretch across the page, not be rendered one per line. I would normally be able to use display: inline in the style sheet, but there doesn't seem to be a selector I can use to group them, so I figure I should add one, but I'm not exactly sure where and how to do so.
I see how to template the output easily enough, but not the input form. While I'm at it, I'd like to move the help text directly below the field lable.
I imagine there's something on the site directed at this, but I can't seem to find it. Thanks in advance for any pointers in the right direction.
Comments
hook_form_alter
You would create a custom module and use hook_form_alter() to modify the form to your liking. See the API docs at api.drupal.org.
--
Rob
Founder and Director
Electronic Insight Corporation
Recent Drupal Projects: MP3PIG | MySpace Layouts
yeah.. and if you get it..
yeah.. and if you get it.. please let me know..
I think I have it
A custom module would be one way to solve it, but I think that would be way more than what I need.
I made a little break-through. When I tried getting the three fields to display inline with just the following styles and no other style sheets, it worked:
Then I applied my theme's style sheet, still it worked.
Then I applied the core drupal stylesheet (misc/drupal.css). That's when it didn't work. Then I narrowed it down:
provided more specificity than my code and so overrode it, putting it back into a display block. There are a few more such that might wreak havoc depending on what you're trying to accomplish:
Now I just need to see if I can write my stylesheet so that it only targets the fields I want, but I'm not sure when I'll get to that, so I thought I'd post my progress in case it helps.
I got it!
I was able to get the selectors specific enough not to apply to anything I don't want them to.
Anyway, to get the three items in the following code to display inline:
I used the following stylesheet commands in my theme's style.css:
It's a little laborious, but it works. :) Unfortunately, the attribute selector is not well supported by older browsers :(, so for the time being I changed includes/theme.inc to produce id instead of for in the label field, and updated the css selector to be:
for wider support. Also the css refers to <div class="standard"> which isn't in the snipped I posted but does seem to be produced on the cck pages, and which sufficiently narrows down the .form-item selector.