By dotidentity on
I used the search functionality, but i didn't find an awnser.
Is want to print my contact form in a block?
Is there a code/snippet to do this?
I used the search functionality, but i didn't find an awnser.
Is want to print my contact form in a block?
Is there a code/snippet to do this?
Comments
good idea. haven't tried it
good idea. haven't tried it myself. but i guess webform module allows page view as well as block view, just give yourself a try. once you had block view enabled, go to block adminitration, enable it for your sidebars. or else use cck
love, light n laughter
gausarts.com
love, light n laughter
probably this module will do
probably this module will do the trick in a simpler manner: http://drupal.org/project/formblock
Take look at next posts and
Take look at next posts and pages on drupal:
- http://drupal.org/node/99778
- http://drupal.org/node/73973 (Quick contact block)
I also would like a contact
I also would like a contact form in a block. I tried the solution in the thread above and got the following error:
warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'quickcontactblock_form' was given in /home/commerci/public_html/includes/form.inc on line 218.
Is this a Drupal 4.7 vs 5.1 issue? Anyone know how to fix it?
=-=
The code for quickcontactblock was written for 4.7, thus it may need to be rewriitten for Drupal 5.x
Contact form in a block (Drupal 5.2)
If you're using the Contact module, you can wrap up the form inside a block without re-writing it.
If you want to tweak form fields you have to indirect both the _page() call and the _submit() call.
Alex Stanhope
Lightenna
Alex - this is great,
Alex - this is great, thanks. I would like to tweak the form fields though. In particular, I'd like to shorten the input lines (as I want the contact form in the sidebar) and I would like to have a couple of additional input fields.
I cannot find a thread giving any information about how to do any of those things. Could you expand a bit on what to do in addition to using your second code snipet above?
contact form in the sidebar
Hello The Smeghead,
I was just trying to do what you want, and I discovered that you can change the properties of a field like you would an array in php. Alex's example above changes just the default category selected, but if you want to change the size of the fields, you can do it like this:
Cheers mi dears,
Drogle
Security issue
This will display (all) the form categories to every user, even anonymous. I want a block for anonymous users but not with every form category displayed; only those which they have access to.
Dagomar Paulides
B.A. Digital Media Design
Partner @ Online Agency
I ran into the same problem
I ran into the same problem and managed to fix it by examining line 463ff. in contact.module...
My code now reads:
hth,
Markus
This is apparently for 5.x,
This is apparently for 5.x, could you please advice on how to tweak field sizes in 6.x? Putting above code in 6.x has given an error.
Have you thought
about using webform
http://drupal.org/project/webform
------
GiorgosK
Geoland Web development / web marketing
------
GiorgosK
Web Development
include the contact.page.inc
It is working, but I am affraid it's a little bit dirty.
use include_once
CAPTCHA
As a note, if you want to use the CAPTCHA module along with this code you'll have to add an entry to your {captcha_points} table that looks like this:
This will make the form function you've defined in that block available in the CAPTCHA admin interface. If you don't do this CAPTCHA won't know that it should be rewriting the form defined by that function.
This contact form in block works well, thank you but
Hi,
Thanks for the code, as this contact form in block works well, but can you tell me how to do if I don't want the MESSAGE box to be resizable ?
I want to set it to 5 rows with
$form['message']['#rows'] = 5;
but I don't want visitors to be able to change it, so how can I do ?
Thanks !
just one problem
Hi again,
after using this code I just found that the MESSAGE box set to $form['message']['#rows'] = 5;
is SOMETIMES too large in FIREFOX and prints above the main content.
Any idea?
Thanks a lot.
I like to print the page
I like to print the page title in the subject field of my contact form?
Can anybody help me?
Redirects to /contact, etc, if
With Contact Forms installed, this solution redirects any page displaying the block to /contact (or whatever the default redirect for the contact forms module is). Proper place for a fix seems to be there so am filing a bug issue there.
Thanx for sharing... was
Thanx for sharing... was looking for a solution to this for a while!
Regards
________________
Live fast die young
Can I embed the 'web form' module that way?
Hi,
Can I embed the 'web form' module that way in a block?
Absolutely.
I just sent around a post about this elsewhere, but will repeat here.
The easiest way to do this is to embed the form in a block using php code. In drupal 5:
(where '16' above is the ID of your webform, gotten from looking at the edit link url on admin/content/webform)
Alternatively, you can define it in a block hook:
For a consistent user experience, make sure you have the webform specify a landing page for the "thank you" message.
When i do this, i recieve
When i do this, i recieve this message:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'webform-client-form-40' was given in /Applications/MAMP/htdocs/Projecten/www.dreamcarsale.nl/includes/form.inc on line 218.
Using the code in contemplate
calling drupal_get_form
This might be of some help in calling
drupal_get_formin Drupal 6. I'm also trying for a contact form in a block and have got something working. (By the way I'm new to Drupal so take my suggestions with a "grain of salt")For
webform_client_form_x, I believe that it's underscores not hyphens for that one. That should get rid of the first error. However you'll then need some additional arguments fordrupal_get_form: two required arguments and two optional ones.This code should work a bit better:
where
drupal_get_formrequires the node for the form and a submission array. Then $enabled and $preview are the optional ones. However you'll likely need to pass $enabled = TRUE, as FALSE seems to be the default. I'm still working out how $preview works exactly.Hope this gets you a bit further.
SUMBAWA - YOU STAR!
Have searched for hours for the answer to this ...... thanks very much!
Unfortunately its not
Unfortunately its not working, i am only seeing a blank block with no content. I am putting the current client form id in the code though :(
I am on 5.6 I think
A long shot, but have you
A long shot, but have you set the input format of the block to php?
Cheers
________________
Live fast die young
This still works (mostly)
In Drupal 6 you have to do the following:
It's best to do error checking though see below: http://drupal.org/node/166432#comment-1319974
Full tutorial :)
OK so now I understand, in full study code case this should look like this (I'm working on D6);
Taada that's all, works great.
Thanks!
Thanks sobi3ch, that works great for me.
Could you not do something
Could you not do something like:
doesn't work for me. the
doesn't work for me. the entire page forwards to /contact. what am i doing wrong?
i did exactly as above
you did exactly as above ?
you did exactly as above ? where ?
you replied to the original thread which has no instructions but a question !!!
There is plenty of things to try in this thread, check the next solution
------
GiorgosK
Web Development
I've tried to and we are in 2011 now...
I've tried too the code above and also to fix permission about the contact block in the permission settings but nothing, I can't see the form or any info in my block, nothing is rendered.
To add a bit to this
To add a bit to this regarding adding a contact form to a block in Drupal 7, I think the following method is frowned upon but works.
For details on the change please see: http://drupal.org/node/224333#unrendered
There's a module for this
There's a module for this http://drupal.org/project/contact_form_blocks
Better to use this module than code above ?
Hi,
Do you know if it is better to use this module than code above ?
Any problem ?
Thanks.
Drupal 7
I just came across this issue with Drupal 7. I usually use the Form block module for putting the contact form in a block. However there is no Drupal 7 release for that module yet. So I wrote a simple module to that puts the sitewide contact form in a block. If anyone needs it you can download it from my Github.
https://github.com/Vikom/contactblock
Contactblock
Viktor,
I used your code but when I send a message with it and I don't know how to debug this at the moment.
Warning: rawurlencode() expects parameter 1 to be string, object given in user_cookie_save() (line 3806 of /var/www/kndev/modules/user/user.module).
Warning: rawurlencode() expects parameter 1 to be string, array given in user_cookie_save() (line 3806 of /var/www/kndev/modules/user/user.module).
Hi It's been a while since I
Hi
It's been a while since I wrote the module. But we're running it on my company website with the stable D7 release and it works fine. No error messages and e-mails are received without any problem. The module is very small and when I take a quick look at it now I don't really see how the module can be related to the error message you're getting. Can you send e-mails from the contact page at /contact?
Contact module not working
Yes I can send from this contact form. Actually I think its a problem with the contact module. Because I disabled your block code and still have this issue
http://kndev.dyndns.biz/contact
Nice litte module: seems to
Nice litte module: seems to work well!
Thank you!!
Isn't this like a basic basic
Isn't this like a basic basic basic thing? Look at this mess? This should be like super straight forward.
=-=
Different strokes for different folks over the years ... thread was started in 2007. There are multiple modules to deal with contact forms in blocks in 2012.