0

I want to add a configuration form for a block. The form's style is the following:

    one year (label)    input text box value    eg:$10     
    two years           input text box value     
    three years         input text box   
    500 accounts        input text box   
    1500 accounts       input text box   
    2500 accounts       input text box   
    image:              can upload an image

How do I do it? I should write a module to get that.

How do I design the table, which is used to store the input box value and image value.
How do I design the fields? Which hook should I use?

2
  • I may be missing something here but did you try the Webform module? From your description, it seems that the webform module will be more than enough for what you are trying to achieve. I also think that since Webform 3.3 you are allowed to insert your forms into blocks. If there is a specific reason why you do not want to use the specific module (e.g. feature missing) please let us know.
    – F1234k
    Commented May 16, 2011 at 14:36
  • i don't want to use Webform module, because it's generate a node. in my condition the form is only inveked by the page-front.tpl,php and a page. if i add a configuration form for a block.this will fit perfectly to my needs.
    – enjoylife
    Commented May 17, 2011 at 2:45

2 Answers 2

2

You can use a combination of the Webform module and Views. Create a node with the form you want using the webform module and you can then create a block with Views for that particular node.

0

The Webform module is a really easy way to design the form you need. Rather than use Views (although it is a dependency of Webform) there is an option within Webform to allow you to use it as a block and easily place it on any page.

Once you have installed Webform module you can create a new content item of type Webform. Save that and then edit it. Go to the advanced settings by choosing the Webform Tab, Form Settings button, Advanced Options (at the bottom).

Select the Available As Block check box.

Now you can add the form to any page(s) as a block by going to Structure - Blocks and adding the new content you've just created.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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