If you meet the following error when viewing the T&C History of the Legal module.
Notice: Undefined variable: options in views_handler_field_locale_language->render()…
Continue reading Drupal 7 – Legal module error – Undefined variable: options in views_handler_field_locale_language->render()
Category Archives: CMS
Drupal 7 – Legal module error – Undefined index: legal_accept in legal_user_update()
If you meet the following error after login,
Notice: Undefined index: legal_accept in legal_user_update()…
Continue reading Drupal 7 – Legal module error – Undefined index: legal_accept in legal_user_update()
Drupal 7 – Create your own Rules event
Update @ 2012-10-25: Please make sure you have the PHP filter module enabled. Thanks Beneto.
The Rules module is must have module for developers who needs to deal with some workflow features. Basically each rule contains 3 parts.
- Event
- Condition
- Action
By default the Rules module already provides some basic events, conditions and actions. But some times we may want to create custom components. For me, the most critical part is create a custom event which i would like to show in this post. For the other two, it is less important because the default components already include Execute custom PHP code. That means even without custom module, i could still do whatever i want in Condition and Action.
Continue reading Drupal 7 – Create your own Rules event
Drupal 7 – Reference field option limit for hierarchy taxonomy
Update @ 2013-11-28: You can also consider using Taxonomy Term Reference Tree Widget suggested by kenorb. =D
When you have a hierarchy structure of taxonomy, the default selection list is not quite user friendly because it list out all the parent and child terms. Assume with want to attach a country and city terms to the Article content type. The most straight forward way is create one vocabulary with some countries as parent terms and some cities as child terms like the following list.
— England
— London
— Manchester
— France
— Lyon
— Paris
It turns on that when someone is adding a new article, he may select either a country term or a city term. That is probably not what we want.
Continue reading Drupal 7 – Reference field option limit for hierarchy taxonomy
Drupal – Embed inline Javascript in node body
Recently i have an client who wants to embeded the FormSite form in the a Drupal 6 website. But after i insert the embedded code in the node body with Full HTML or PHP Code filters. Nothing is shown. For example, if i enter the following code in the node body.
Continue reading Drupal – Embed inline Javascript in node body
Drupal 7 – Add the Facebook Connect login button on user registration and login page
In the past 2 days we have talked about the use of Facebook Connect module.
Drupal 7 – Allow Facebook login using Facebook Connect
Drupal 7 – Override the Facebook Connect login button theme
In this post, i will show you how to render the Facebook Login button programmatically in the Drupal user registration and login page.
The following code will render the Facebook Login button programmatically.
$user_profile = fbconnect_user_profile();
$attr = array();
if (variable_get('fbconnect_fast_reg', 0) && variable_get('fbconnect_reg_options', 0)) {
$attr = array('perms' => 'email');
}
$ss__facebook_connect = fbconnect_render_button($attr);
Drupal 7 – Override the Facebook Connect login button theme
We can implement Facebook Login using Facebook Connect. For more info, please refer to
Drupal 7 – Allow Facebook login using Facebook Connect
For those who wants to override that Facebook Login template, add the following function in your theme template.php and and customize it as u wish.
Continue reading Drupal 7 – Override the Facebook Connect login button theme
Drupal 7 – Allow Facebook login using Facebook Connect
The website i am working now needs to have Facebook Login. I found 3 modules which could implement that feature.
Facebook Connect requires the Facebook PHP SDK and the configuration is quite user friendly and this is also the module which i used.
Facebook OAuth provides an API for authentication and does not need the Facebook PHP SDK. It fits for Drupal developesr who wants higher level of customization.
Drupal for Facebook seems to target Facebook application development. I didn’t tried it.
Continue reading Drupal 7 – Allow Facebook login using Facebook Connect
Drupal 7 – Add class to link using l()
l('<link text>', '<link path>', array('attributes' => array('class' => array('class-a', 'class-b'))));
Done =)
Reference: Drupal API – l()
Drupal 7 – Sort the Views PHP value
I use the Views PHP field to retrieve a numeric value from database, but it could not be sorted even after i have checked the Enable click sort and select Sort numerically.

It will throws an error.
Continue reading Drupal 7 – Sort the Views PHP value