dblue
  • Member for 7 years, 11 months
  • Last seen more than 5 years ago
Webform select list multiple selection
Accepted answer
3 votes

On the edit screen for your select list component (node/NODE_ID/webform/components/COMPONENT_ID), there's a checkbox labeled "Multiple" whose description says "Check this option if the user should be ...

View answer
Correct way to render fields from Entities?
Accepted answer
3 votes

The equivalent to the sample code you posted from the article, but for an entity type other than node would be: $entities = entity_load('ENTITY_TYPE_NAME', array($YOUR_ENTITY_ID)); $entity = $...

View answer
I am unable to login using linkedin integration module drupal 7?
Accepted answer
3 votes

The LinkedIn Integration module won't automatically create a new user account for you. From step 5 of the directions in the module's README: Usage : Users will have to associate their LinkedIn ...

View answer
Creating a custom views access plugin
2 votes

As noted on the documentation for hook_views_plugins(): handler (required): The name of the file containing the class describing the handler, which must also be the name of the handler's class. ...

View answer
Webform submitted data field names
2 votes

The $node argument to hook_webform_submission_insert() contains the info you're looking for. For a Webform node, you'll find an array $node->webform->components where, for example, $node->...

View answer
How to hide Profile2 entity fron user view?
1 votes

At admin/people/permissions you can configure what user roles are allowed access to the Profile 2 profiles on a per-profile-type basis. So if you're alright with letting admin users see the profiles, ...

View answer
Hide Drupal Web Form until Logged in?
Accepted answer
1 votes

I haven't done this, but it should work to do something like this: Once you've created the webform, on the settings for your webform, under "Submission access" you can choose to restrict "Roles that ...

View answer
How to get values which changed during node edit in node api?
Accepted answer
1 votes

The $node argument to hook_node_update contains a $node->original object. With that you can identify the newly added user IDs by comparing $node->your_user_ref_field to $node->original->...

View answer
Creating webform submissions programatically in order to use with SimpleTest
1 votes

You can programatically submit a Drupal form with drupal_form_submit() by passing it a $form_state array with its values sub-array pre-populated with the data you want to submit. You'll need the form ...

View answer
custom template for entity as referenced entity
Accepted answer
1 votes

What you can do is to add a custom view mode for your node type, and then use the new view mode for your entity reference field. You have a couple of options, depending on whether you want to code a ...

View answer
Coloring rows in returned drupal search results
Accepted answer
1 votes

In your search-result.tpl.php you should have a $zebra variable available for your use, which will be either "odd" or "even" so you can use that in place of trying to track your $inc variable. The $...

View answer
drupal store and retrieve variable from $_POST array
1 votes

If I understand your question correctly, in your form's submit handler, you want to capture some of the input from your submitted form, and then use that as input which you then want to POST to ...

View answer
Checking for an empty entity reference field in hook_node_validate
1 votes

Take a look at entityreference_field_is_empty(), which at least will get you up a level by checking if target_id is empty on your behalf.

View answer
Custom nested element and its child sub-elements callbacks
0 votes

In your function TST_element_valdate, to get the value of your timeperiod element, instead of $Per = $element['#value']['Per']; try either $Per = $element['Per']['#value']; or $Per = $form_state['...

View answer
How to make a page the home page of another domain
0 votes

If you need to accomplish this with a custom module instead of following Shawn Conn's suggestion of a multisite setup, you can do something along the lines of adding a menu handler whose callback will ...

View answer
Remove "pubdate" attribute from Submitted Time tag in Drupal 7
Accepted answer
0 votes

So `$variables['submitted'] is the one you want to override in your theme's preprocess_node function. Try this as a starting point: function ThemeName_preprocess_node(&$variables) { $variables['...

View answer
Entity filed query for sorting by title and weight both?
0 votes

This is more of a straight PHP question than a Drupal question, but it looks as if you have a bug in your value comparing function. It should return 1 if you want $a to sort greater than $b, it should ...

View answer
Check if a taxonomy term synonym exists
Accepted answer
0 votes

Edited my answer since my original answer referred to dev code. The following simple module works with Drupal 7.34 and the current stable version of synonyms (7.x-1.2) and successfully matches a ...

View answer