In drupal 7, get a taxonomy token replaced in a panelizer webform - drupal

Here's my scenario: I have a drupal 7 site. It's categorized by a taxonomy. Each taxonomy term is panelized to display its main page. For each of those pages, I want to add a webform that would allow the visitor to email the person responsible for that area. The responsible person is defined in a hidden field on the taxonomy term.
If I add custom content to the panelizer page with the token
%taxonomy_term:field-generic-email-address
the email address is displayed. However, I need to get that into the webform, and I can't get it to pull the value from the token - it just displays that exact text (I'm trying to add it to a hidden field, but I'm sticking it into the body just to see, and in either place, it shows the token text instead of replacing it with the email). Does anyone know how to do this?

You might want to check out a module called EntityForm https://drupal.org/project/entityform
It allows you to use regular Drupal fields to build a user-submittable form.
There are other ways to do this, but this method may allow you to get what you want and more.

Related

In JetEngine Forms, where are the submissions / entries stored?

In WordPress JetEngine Forms you can create forms. When a user submits it, where does the data go? In GravityForms, you can edit a form and see a list of all submissions so far. Does JetEngine honestly lack that? Can't find it in the docs; can't find them in the DB either.
As a workaround you can auto-create a post of the (JetEngine) custom post type (i.e.) "form submission".
First set up the custom post type. Make sure to exclude it from the search. You can set it to private too, but then it doesn't appear in the forms dropdown anymore where we're gonna need it. (You can make the CPT public first, then set up the action, and make the CPT private afterwards. The association in the action's dropdown still stands, albeit now the dropdown value is empty … Seems a bit buggy and dangerous to do it that way)
Create a Meta Field for each form field.
Then edit the form and, next to "Send mail" or whatever your primary submit action is, add another action which is to "Insert/Update Post". Choose the CPT and map the form fields to the meta fields.
It's a bit cumbersome because of this redundant field management … But it's doable.

How to use custom fields globally in Wordpress?

I'm trying to use the value of one custom field on multiple pages and posts. I'm a newbie to PHP and custom fields so what I'm trying to accomplish could possible be done using a different method.
I have a WPMU setup with all new sites created from a default blog that includes multiple custom post type templates. When users create a new site they are redirected to their site admin dashboard.
Here comes my challenge, I want users to be able to enter information into form fields contained in metabox(es) on their admin dashboard (not post editor) that will be used on the various custom post type templates. For example, a user will need to enter their company name, address, logo, etc.
Depending on the temple, the information entered into the form fields will be used on the frontend of the site. For example, the company logo will be display where the custom field or shortcode is placed on the post template.
I'm having issues using custom fields for this because each custom field is specific to each post. In addition, I'm having issues rendering a form on the admin dashboard for this.
I'm also thinking that custom fields may not be the best way to accomplish my objective because they are usually post specific. I'm really asking for a variable that will be used globally and is static unless the user updates the form.
I'd appreciate any assistance on this.
The options API is what you will need for this:
http://codex.wordpress.org/Options_API
There's also some plugins and frameworks you can use to help such as:
https://wordpress.org/plugins/options-framework/
https://wordpress.org/plugins/redux-framework/

Email to node author in Drupal 7

Drupal 7:
I need a module to append a contact form to a node of a specific content type. The form should be configurable and permit to send an email with an attachment to the node author. The form should also have a captcha. The email must not be saved in the database.
Does such module exists or do i need to develop it ?
You should be able to achieve this through the combination of the webform module, CAPTCHA module and a custom module.
Webform defines it's own 'webform' content type, but it also allows you to make other content types webform enabled by visiting 'admin/config/content/webform' and selecting the appropriate content type.
The token module provides node tokens such as nid and title which can be included as a hidden form element, but annoyingly, doesn't include the author as a token.
On the email tab of your webform, it's possible to choose a form component as the email address to send the form results to. I would create a hidden field, leaving the default value blank and then it should be fairly easy to add the node author value to it in a custom module using hook_form_alter (form id can be found by viewing source and looking for the hidden input 'form_id'). You can then use this form component in the email tab to send the results to.
The only thing I can see causing an issue is that there isn't an easy way to stop webform recording the form result in the database - I would imagine this would be achievable in a custom module without too much hassle though.
Yop, there is such a module. It's called Webform. Using Webform you can add a block form under certain node type with predefined fields and let send email directly to the node author.
Download and enable Webform 4.x
Create new from, add desired fields
Under E-mails tab for Address use token [current-page:node:author:mail]
In Form settings tab check Available as block
Configure newly enabled block (show only under certain node type + set restricted pages to the node/*/*)
Do tests
You can find printcreens and more detailed instructions here.

How to display blocks of text in drupal?

I'm trying to build a module that lets users with a certain role post messages that will be displayed for users with a different role. I'd like this to simply be one module that handles both these things, however, the furthest I've gotten is setting up the form to post messages.
I'd like to show the posted messages on the same page as the input form (and hide the form for the unauthorised users), but I just can't figure out what I have to do to show the messages. How hard can it be to display some simple text?
So far I've added an item to the menu that links to the page with a form on it.
You could make use of the boxes module to have online editing of this text that other users will see. If you're set on Using your custom Form you could put your text in a block.
The Content Access module will let you restrict view permission for a given content type to users having a certain role.
For setting up the layout, you might want to put the posted messages in a block or use Panels.

Drupal6 - Display specific View from a specific user in page

I need a help displaying a specific View result in a page which the user created it.
story...
"User X has created a Page called My Store and UserX has products which was created in custom Content Item."
Now how do I show this UserX's products in his My Store page?
I have already made a view called User_Store_View, I added a Page Display and on Page Settings:Path, the value was "node/%".. now I guess my problem is on the Arguments?
The path should be something like my-store and it should have an argument of user id. Given your requirements I think setting the default behaviour for the argument being invalid or not being supplied to an empty result set would be the most sensible(I think the default is show all). That may be all you really need.
However, if your product is a type that you've created yourself you will need to do some behind the scenes wiring to expose all your fields to Views; it's almost always better to build a content type using CCK so it's already hooked up to Views. And D7 is a different beast in this regard, with fields part of core and whatnot, so I can't help you out there.

Resources