Drupal

[Drupal 6] change theme in user edit page

First of all we need to create a custom module, for example my_module, then in the implementation of the hook_init() :

function my_module_init(){
    global custom_theme;
    if (arg(0) == 'user' && arg(2) == 'edit') {
      $custom_theme = 'adaptivetheme_admin';
      init_theme();
    }
  }

Enjoy !

[Drupal] Programtically add custom meta tags to pages.

Assuming that we need to add custom meta tags by page url or node type, drupal hook_preprocess_page() is the last function called before displaying the page, so it's the right place for doing that :

Drupal 6 : An illegal choice has been detected.

Drupal form control can be tiresome some times, especially when developping custom modules .. In my case it was the integration of country and region select boxes from the ubercart module.

In my implementation of hook_form_alter we are adding these two elements in code :

Syndicate content