Skip to main content

Home/ Drupal for Developers/ Group items matching "blog" in title, tags, annotations or url

Group items matching
in title, tags, annotations or url

Sort By: Relevance | Date Filter: All | Bookmarks | Topics Simple Middle
6More

Theming the User Registration Form in Drupal 6 | Trellon - 0 views

  • <?phpfunction themename_theme($existing, $type, $theme, $path) {  return array(    ...    // tell Drupal what template to use for the user register form    'user_register' => array(      'arguments' => array('form' => NULL),      'template' => 'user-register', // this is the name of the template    ),    ...  );}?>
  • <div id="registration_form">  <div class="field">    <?php      print drupal_render($form['account']['name']); // prints the username field    ?>  </div>  <div class="field">    <?php      print drupal_render($form['account']['pass']); // print the password field    ?>  </div>  <div class="field">    <?php        print drupal_render($form['submit']); // print the submit button      ?>    </div>  </div></div>
  • <?php  print '<pre>';  print var_export($form);  print '</pre>';?>
  • ...3 more annotations...
  • Don't forget to render hidden fields or it won't work ;) echo drupal_render($form['timezone']); echo drupal_render($form['form_build_id']); echo drupal_render($form['form_id']);
  • you also have to print the "token" in order to make the form work print drupal_render($form['form_token']);
  • From my own experience using a form tpl.php, you need to print the whole $form at the very end of the template to ensure that the form will validate upon submission. <?php print drupal_render($form); ?> Just adding the hidden form_build_id and the form_id fields will not mean the form will work. Printing the entire form at the end, however, will mean that all the stuff you wanted to hide in making the template will show. For those fields, include "unset" statements for each one: <?php unset($form['field_to_hide']); ?> Please correct me if I'm wrong or if there is a better way to do this.
1More

Apache Solr and Drupal Default's Search | Trellon - 0 views

  • One issue that comes up from ApacheSolr being a separate search page is that the search form does not go to it by default. This is the $search_box in the page.tpl.php template. The way we change this behavior is to add a new submission handler to that form. You can create a custom module for this or put it in your custom theme. <?php/*** Implementation of hook_form_alter()*/function custommodule_form_alter(&$form, $form_state, $form_id) {  // Add submission handler to redirect to apachesolr  if ($form_id == 'search_theme_form') {    // Add a submit, because the search form redirects to a specific place    $form['#submit'][] = 'custommodule_search_submit';  }}/*** Implementation of form submit function*/function custommodule_search_submit($form, &$form_state) {  // Get form ID  $form_id = $form['form_id']['#value'];  // Create new redirect  $form_state['redirect'] = 'search/apachesolr_search/'. trim($form_state['values'][$form_id]);}?>
1More

Drupal Web development ,Drupal theming,Drupal Services Blogs | Ebizon NetInfo - 0 views

  •  
    This post enlists the benefits associated with adapting the Drupal technology and also shares examples of popular drupal powered websites on the internet.
2More

Programmatically Create, Insert, and Update CCK Nodes | doug | CivicActions - 2 views

  • Always use content_database_info to get the database info. For example:   $field1 = content_database_info(content_fields('yourfield1', 'yourtable'));  $table1 = $field1['table'];  $column1 = $field1['columns']['value']['column'];  $field2 = content_database_info(content_fields('yourfield2', 'yourtable'));  $table2 = $field2['table'];  $column2 = $field2['columns']['value']['column'];  if ($table1 == $table2) {    $sql = "SELECT n.*, t1.$column1, t1.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";  }  else {    $sql = "SELECT n.*, t1.$column1, t2.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";    $sql .= " INNER JOIN {$table2} t2 ON t2.nid = n.nid AND t2.vid = n.vid";  }  $sql .= " WHERE n.nid = %d";
  •  
    Important point: Using special functions to let CCK get the proper name of the field (allowing users to make CCK changes in the UI and let your code continue to work).
1More

Drupal Community: It takes a village to build a world-class CMS. See what they have to ... - 0 views

  •  
    Drupal has powered over a million websites - each of them tailor-made and unique to their brands. But, who is behind the success of Drupal? What makes Drupal so powerful? Read some real stories from some real people behind the success of Drupal and get inspired.

Why should Drupal be your first choice of open source CMS? - 1 views

started by innoraft on 25 Jun 19 no follow-up yet

Content migration in Drupal from XML Source - 1 views

started by innoraft on 25 Jun 19 no follow-up yet

TB mega menu implementation with a demonstration (Part 2) - 0 views

started by innoraft on 01 Jul 19 no follow-up yet
1More

A Complete Guide To Hire A Drupal Developer For Your Project | Specbee - 0 views

  •  
    A step by step guide to hire a Drupal developer. Know everything about how to hire the right resource for your Drupal project.

How does entity cache work in Drupal 8 - 0 views

started by innoraft on 26 Aug 19 no follow-up yet
1More

How to perform Automated Backups on a Drupal 8 (or 9) Website | Specbee - 0 views

  •  
    Automation always takes a load off. Drupal 8 and Drupal 9 offers different ways to perform #automated_backups on your Drupal website. Learn more about using the #Backup and migrate Drupal module and CLI methods to #automate your backups.
1More

How to Control Access to Restricted Pages with the Rabbit Hole Module in Drupal 8 | Spe... - 0 views

  •  
    The Rabbit hole module for Drupal 8 (also compatible with Drupal 9!) is a very popular Drupal module that enables you to restrict access to certain pages. Read more about how you can implement it.
« First ‹ Previous 81 - 100 of 104 Next ›
Showing 20 items per page