Tag: drupal planet

07 Nov, 13

Programmatically Hiding A Fieldgroup On A Node Display in Drupal 7

If you have a fieldgroup in a node, you may want to hide it on some conditions. Here's how to do that programmatically. At first, we need to preprocess our node like this:

  1. /**
  2. * Implements hook_preprocess_HOOK().
  3. */
  4. function MODULE_NAME_preprocess_node(&$variables) {
  5. }

The tricky part starts here, if ...

Read now
29 Oct, 13

Raw username token for Drupal 7

There are situations, when you or other modules alter username via hook_username_alter() and this can change username dramatically: for example, you can alter username into a combination of First and Last Name, etc. Looks nice, but there's a problem, it will alter username into First and Last Name everywhere, even ...

Read now
01 Oct, 13

All DrupalCon Prague 2013 Videos On One Page

If you've missed DrupalCon Prague 2013 or, maybe, you want to relive once again this great party go and see all videos from the event on this page: all DrupalCon 2013 Prague videos. There you'll find 4 days, 7 hours long video material (104 videos)!

Read now
29 Jul, 13

How To Redirect User To Any Page After Login in Drupal 7

There are loads of modules that can do this for you, but why to install one more module if you can do this with one string of code? The best thing is that approach below does a redirection even if you login from user login block.

Just put the following ...

Read now
04 Jul, 13

Five Resources To Learn Drupal PHP

I often get emails from beginner Drupal developers asking "Where to learn PHP for Drupal or Drupal PHP?". Actually, "Drupal PHP" is an interesting term, that in the language of beginners means "how to learn writing custom modules and do customizations and understand Drupal internals" that equals to learning ...

Read now
02 Jul, 13

Poor man's VPN for Web Developers or Make Remote Server Local Or How To Make Developer's Life Easier While Working With Remote Servers

"Woa, what a long title", you must say. Yes it is and it deserves that for sure. But at first, please answer this question: "How many times you've been forced to work on client's server, because of the fact that there are services, that work only with remote server's localhost ...

Read now
30 May, 13

Migrate Module Caveats. May Save You Some Time... and Hair

While working with Migrate and Migrate 2.6 beta 1 I stumbled upon several undocumented "surprises" which are hopefully going to be documented, but so far, you can spend lots of time trying to figure out what may be wrong. Here's roundup of my findings:

1. There is one correct ...

Read now
28 May, 13

Using Hash Value (track_changes) To Detect Source Data Changes in Migrate for Drupal 7

When you import data with Migrate (http://drupal.org/project/migrate) it is nice to have ability to update already imported data if source has changed. To track updated data Migrate uses highwater marks (more on this: http://drupal.org/node/1223936). Highwater mark is a column of a source ...

Read now
24 May, 13

Cool New Changes at Dropbucket.org

Hi everyone, hope some of you had/having a great time at DrupalCon Portland. Since I could go I decided to do something useful and apply to Dropbucket Drupal Snippets Repository some new ideas I had in my mind. Long story short, last night I rolled out an update which ...

Read now
02 May, 13

Find Out Form ID Easily with Get Form ID Module for Drupal 7

"How to find form id in Drupal" is one of the most popular questions, especially for the beginners. More experienced developers know that to find form id you need to either look into the DOM source code or to create your own hook_form_alter() function like this:

  1. function ...
Read now