0

I am fairly new to Drupal 7.9 and still trying to get a hang of it. Understandably it has a learning curve which I am trying to scale at the moment.

My challenge here is to basically create a page that has some backend processing to it. The front page consists of form elements (mostly textboxes) arranged in a tabular format.

A little bit of exploring and I reckoned I might need to create a kind of content type and then add content. But I got nowhere with this.

Then I discovered the webform module that lets me create form elements and provides a bunch of operations. But it doesn't necessarily allow me to display my form elements in tabular format.

So before exploring on my own again, I felt it would be right to ask questions from you guys.

Anybody with any leads on this ?

Thanks much !!!

Parijat

1

You probably need to explain what you mean by "background processing", i.e. are you looking to save content or do something else?

At any rate, if you really need to template your form to be table based, this is possible by implementing hook_theme. An example entry for a form with an id of example_search_form (this is the argument passed to drupal_get_form() or can be found by looking at the id of the generated form by viewing source) and a template file called example-search.tpl.php looks like:

  $hooks['example_search_form'] = array(
    'arguments' => array('form' => NULL),
    'template' => 'example-search',
  );

  return $hooks;

Then in your example-search.tpl.php you can render individual form items however you would like.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.