Skip to main content

Home/ Groups/ Drupal for Developers
Daniel Gregoire

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]);}?>
Daniel Gregoire

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.
Scott Blackburn

Internet Archive Search: subject:"DrupalCon DC 2009" - 0 views

  •  
    The full list of videos from the DrupalCon DC. Looks like I have a ton of viewing to do.
Daniel Gregoire

Configuring settings using drupal_execute | drupal.org - 0 views

  •  
    Tagged for D5, but has D6 examples. Using drupal_execute (to be called drupal_form_submit in D7) to set site settings programmatically.
Daniel Gregoire

drupal_execute | DrupalContrib - 0 views

  •  
    Actual documentation for drupal_execute
Daniel Gregoire

Batch operations | Drupal API - 0 views

  •  
    Basic Batch API explanation
Daniel Gregoire

Batch API | drupal.org - 0 views

  •  
    Another Batch API example, handbook
Daniel Gregoire

node_example.module | Drupal API - 0 views

  •  
    Basic creation of programmatic custom content type
Daniel Gregoire

PHP 5.2.10 .debs for Ubuntu 10.4 (Lucid) | The Jibe Multimedia, Inc. - Business Solutions - 0 views

  •  
    Resource for .deb file for PHP 5.2 on Lucid Lynx (Ubuntu 10.04), since we only have deb's for 5.3 by default, which makes Drupal contributed modules unhappy.
Daniel Gregoire

drupal_hash_base64 | Drupal API - 0 views

  •  
    Drupal 7 function for generating url-safe sha-2 hashes.
Daniel Gregoire

The New Way To Generate Hashes In Drupal 7 | Engineered Web - 0 views

  •  
    Explanation of shift away from md5 to sha-2. See links to Drupal 7 api for (really easy) functions for generating url-safe sha-2 hashes.
Scott Blackburn

Remove 'Formatting guidelines' | drupal.org - 0 views

  • <?php/** Override filter.module's theme_filter_tips() function to disable tips display.*/function phptemplate_filter_tips($tips, $long = FALSE, $extra = '') {  return '';}function phptemplate_filter_tips_more_info () {  return '';}?>
Scott Blackburn

How to make CCK fields do some of the same tricks as taxonomy terms | !&# - 0 views

  • In Drupal, taxonomy.module implements hook_term to provide links among content which shares a given term. Site builders often use this feature to provide indexes and RSS feeds of their content. Taxonomy.module's purpose is to support the creation of controlled vocabularies which we can use to classify our site's content. If taxonomy.module were a prescription drug, this would be its "on-label" or indicated use. Using taxonomy.module vocabularies and terms to store essential data about our content is what I call an "off-label" use. You're not really creating a controlled vocabulary, and the term-node relationship in these cases isn't always classificatory. However, a clever web developer will use the tools that get the job done, and often taxonomy.module is the perfect tool for making this happen. Because this information is essential to your node's content, CCK fields are indicated for this use. However, CCK fields don't have built-in linking among nodes which share values for the same field. Also absent is any built-in RSS feed for a CCK field's value. This requires some theming and Views.
Daniel Gregoire

Module Development - Schema Won't Install | drupal.org - 0 views

  • I had similar symptoms ... a simple install file that wouldn't create a table. However, I got it to work by going into the Drupal system table and deleting the record for my module. Then the next time that I enabled my module, Drupal freshly discovered it and ran the .install file to successfully create the table. Summary. When you have a module already in use (and so it appears in the system table), and *then* as a developer you create its .install file, it doesn't look like a *new* installation to Drupal (since the module name was already in the system table), so hook_install never gets called.
  •  
    Trick for schema's that won't install. If you have a custom module that you _had_ installed before making a .install file and including a schema, you need to: (1) Disable your module (2) Uninstall your module (3) Delete your module's row in the 'system' table in your Drupal database. Then you can re-introduce your module, and all its files will be recognized.
Daniel Gregoire

Setup of /sites directory for multi-site | drupal.org - 0 views

  •  
    Good overview of directory structure for setting up Drupal multisite installations.
Scott Blackburn

Panels 3 / CTools TODO list: | groups.drupal.org - 0 views

  •  
    Merlinofchaos's TODO list: This is a rough TODO list generated from my personal notes regarding tasks that remain to be done for Panels 3 to complete the alpha stage. This does not include the obvious tasks of find/fix bugs/trim the issue queue.
Scott Blackburn

Making Subversion/SVN recognize CVS Id and Revision tags | 2bits.com, Inc. - Drupal Dev... - 0 views

  •  
    One annoying aspect though is that almost all Drupal files use CVS style tags, such as the $Id$ one. Subversion does not recognize these by default. However, there is a way to make Subversion recognize these tags. This post describes the steps needed to achieve this goal.
Scott Blackburn

Limit Views-created block content by node author or current node | Geeks & God - 0 views

  •  
    Scenario One: Limit by author of current node Scenario Two: Limit source to CCK fields in the current node
Scott Blackburn

have you seen ProjectPier? | groups.drupal.org - 0 views

  • We – eCentres.net - are using, with a lot of problem of daily configuration and setting, rather than 60 modules and three subdomains. The collaborative community – working in European research projects - now has a basecamp of 3000 users – biannual newsletters - and 300 collaborative participants, who needs mainly: a join calendar of events; the work-groups and all the rest of traditional modules associated. In addition, the basic forum and messaging and all the modules - it is needed more - of users, communities and profiles, usermap, userlist, search users, directory, etc On the other hand the modules of sharing files and documents - not absolutely solved - maybe with the drupal-ftp module... And finally and a lot important the media sections, podcasts, image gallery and video section - not well solved. The next steps is to integrate the donations, fees and commercial solutions and multichannel communication as SMS, and skype and IRC solutions and webminars. Any other simple or partially CWE in my honest opinion are not really sustainable.
  •  
    have you seen ProjectPier?
« First ‹ Previous 81 - 100 Next › Last »
Showing 20 items per page