I want to create a Contact Author From.

I have created a webform for a content type. I want to insert a button into the content display which a user can click on that brings up a webform to contact that content author.

I am struggling to get the button to open the webform, and how do I assign the author?

Comments

Stefan Lehmann’s picture

Are you able to code some simple Javascript? Otherwise I don't think you will be able to accomplish that.

I like cookies!

dotmundo’s picture

I don't understand, when the user clicks on the button, does the Webform suppose to dynamically appear on the page or are you refreshing the page to display the webform?

bjmagar1906’s picture

Simple Solution:

1) Copy the node.tpl.php in your theme.
2)Rename it node--"yourContentTypeMachineName".tpl.php
for example my custom file is now node--job_opening.tpl.php
3) To test it out write some text(anything) in your new template file.
4)Paste your new node.tpl file back in you theme folder
5)Clear all cache
if you go back to the content node on your Dupal site you should see the text you wrote in the file

More Dynamic Solution:
You can use hook_node_view hook add new variable for your link or button that linked to Author contact form. You have to add a template file page--YOUR_CONTENT_TYPE.tpl.php and place the link inside new created template. Clear cache. you will see the newly added content.

Look at Drupal 7 Template Suggestions.

Stefan Lehmann’s picture

Wow .. I don't want to see your complicated version then. :D ..

I like cookies!