drupal

Drupal - Webforms as Block - Modifying Action

[亡魂溺海] 提交于 2020-01-06 07:01:32
问题 I am using Drupal 7.15, and have a Webform setup as a block that gets included on the Contact page (a basic page). The basic Contact page has editable sidebar content and then the Webform block as the main content. The problem I am having is on submission the Webform goes to its own alias 'general-inqueries' rather than the Contact us alias 'contact-us'. I want it to return to the basic page Contact Us with any validation errors and/or confirmation message. It seems the form action is always

Drupal - Webforms as Block - Modifying Action

北城余情 提交于 2020-01-06 07:01:26
问题 I am using Drupal 7.15, and have a Webform setup as a block that gets included on the Contact page (a basic page). The basic Contact page has editable sidebar content and then the Webform block as the main content. The problem I am having is on submission the Webform goes to its own alias 'general-inqueries' rather than the Contact us alias 'contact-us'. I want it to return to the basic page Contact Us with any validation errors and/or confirmation message. It seems the form action is always

Drupal 6: Only inserting first character of value to MySQL

我的未来我决定 提交于 2020-01-06 03:37:06
问题 I am working with a hook_form_alter on a CCK type (for you drupal-ers). I have a field that is normally a select list in my node form. However, in this instance, I want to hide the select list, and populate its value in the form with an SQL query. Everything was going nicely. I could see that my desired value was showing up in the HTML source, so I knew my query was executing properly. However, when I submit the form, it only inserts the first character of the value. A few of my tests were

Is it possible to share users between a Drupal 6.x and Open Atrium database, based on organic groups or CiviCRM smart groups?

ⅰ亾dé卋堺 提交于 2020-01-06 03:25:27
问题 I use Drupal with CiviCRM for our nonprofit's public site and CRM database, and Open Atrium for the intranet. My goal is to either sync or share specific users from the public site to the intranet, to allow single sign-on. However, only users who are part of a specific CiviCRM smart group (volunteers) should be shared/synced. I could use the module to sync CiviCRM groups with Drupal organic groups if that would make this task easier. Any thoughts? 回答1: Usually, the Domain Access module is

How to write regular expression to match free email accounts?

此生再无相见时 提交于 2020-01-06 02:22:30
问题 I'm trying to write a regular expression that checks if an email form field contains a free email address, with no luck. Essentially I need to check if the email contains: hotmail , yahoo , gmail etc in the email field. 回答1: regex would be sth like: [a-zA-Z0-9_\.+]+@(gmail|yahoo|hotmail)(\.[a-z]{2,3}){1,2} you can add all the other domains you want... does it help you? 回答2: /\@(hotmail|yahoo|gmail)\.com/ 回答3: Have you tried a big ol' disjunction? i.e. yahoo\.com|googlemail\.com|blah\.net Pros

How to use hook alter form in module to register a user and also save some data in another table?

烈酒焚心 提交于 2020-01-06 01:57:07
问题 have a general idea on how to use hook alter to modify the feel of the registration form . However the challenge I have is to not only have the user register, but to save some extra data into another table and then redirect user to a new page. How would I get about doing that? Please help 回答1: Again, it'd be easier to plan what you're trying to do and take advantage of common solutions. I suspect what you're after is the Content Profile module. 回答2: add a custom function to your form,

How to remove permissions offline_access and publish_stream in scope variable

扶醉桌前 提交于 2020-01-06 01:05:12
问题 I have error when I want login drupal 7 with facebook account and I use module hybridauth. like this: Invalid Scopes: offline_access, publish_stream. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions From same question I found the answer and it is to remove permissions offline_access and publish_stream in scope variable but

Cascaded select list as a custom field using hook_field_widget_form in drupal 7

做~自己de王妃 提交于 2020-01-05 08:06:02
问题 Problem I have written a Drupal custom module for a custom field. The field contains three cascaded select list. I am populating the lists using javascript. Now I need to populate it inside "hook_field_widget_form" hook. My hook_field_widget_form is as below: /** * Implements hook_field_widget_form(). */ function custom_select_list_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { $node = menu_get_object(); $division = isset($node->field

Select the latest node for each defined taxonomy term in Drupal 6

女生的网名这么多〃 提交于 2020-01-05 07:37:14
问题 Can anyone help me out with a query to display 1 node for each taxonomy in Drupal 6? For example, I have 4 taxonomy terms (tid = 21, 22, 23, 24) in a 1 vocabulary (vid = 3). I would like to display a table showing: Taxonomy Term: Taxonomy Description Number of Nodes in Taxonomy Term Title of latest node in taxonomy term Last Commented/Updated Date Thanks, JK 回答1: Actually, just use http://drupal.org/project/views =) You don't need any hooks, etc. and if you need to output this view in your

Combining databases in Drupal

霸气de小男生 提交于 2020-01-05 06:28:51
问题 So here's the scenario: I am building a series of event websites that need to be separate Drupal-6 installations on the same server. Each uses the same architecture but different URLs and themes. What I'd like the sites to be able to share is content in 2 content types, teachers and sponsors. So that there would be one database with all the teachers and sponsors that each individual event site could then pull from by means of nodequeues. So that new teacher nodes and sponsor nodes can be