Currently Browsing: web programming

Fix the “No front page content has been created yet.” in Drupal 7 problem

You can hide the “No front page content has been created yet.” in Drupal 7 by adding the following to your local.css:

#first-time {
display: none;
}

buy soap locally

here in santa barbara, ca you can buy soap made locally: http://www.sweetleafessentials.com/

Their website is powered by Drupal too…


Graphing wind speed and direction using RRDtool

Using XML feeds from wunderground.com you can easily graph wind speed and direction with RRDtool and then format the output with PHP for iPhone. Below is a screenshot of a site I created at http://redigital.org/wind/ which tracks various weather stations in Santa Barbara, CA and Sedona, AZ.

Most of my source code is available at http://redigital.org/wp/?p=143 but I can post anything that’s missing.


Drupal: Sorting by last name given the Title in a link field

preg_match('~([^\s]+)(?:,.*)?$~',$node->field_faculty_link[0]['title'], $match);
$node_field[0]['value'] = $match[0];

Extracting First and Last name from a single field in a drupal content-type

It is possible to extract the first or last name from a single field in a drupal content-type using the computed_field module. Here were my steps, taken from the drupal structure guide :

  1. install computed_field and dependencies
  2. % drush dl computed_field
    Project computed_field (6.x-1.0-beta3) downloaded to      [success]
    /var/www/drupal6/sites/all/modules/computed_field.
    % drush en computed_field
    The following projects will be enabled: computed_field
    Do you really want to continue? (y/n): y
    computed_field was enabled successfully.                  [ok]
  3. edit your content type
  4. add a new ‘Computed’ field
  5. under Global settings, make certain the ‘Computed Field’ is in plain-text mode
  6. for last name
    • // compute last name
      preg_match('~([^\s]+)(?:,.*)?$~',$node->title, $match);
      $node_field[0]['value'] = $match[0];
    • for first name:
      // compute first name
      $node_field[0]['value'] = \
                      substr($node->title, 0, strrpos($node->title, " "));
  7. change data-type to “varchar”
  8. enable/check “Sortable”
  9. Save content-type
  10. Edit your view
  11. Add a ‘Sort Criteria’
  12. Use Content: Computed Last Name (field_computed_lastname)
  13. Click ‘Update’ and then save your view
  14. Navigate to the page where your listing is to see the new sorted version

« Previous Entries

Powered by WordPress | Designed by Elegant Themes