Drupal Step-by-Step: How We Built Our Training Site, Part 1

3,700 views

Published on

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,700
On SlideShare
0
From Embeds
0
Number of Embeds
981
Actions
Shares
0
Downloads
63
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Drupal Step-by-Step: How We Built Our Training Site, Part 1

  1. 1. Drupal Step-by-Step: How We Built Our Training site (part 1) Site architecture and construction
  2. 2. We use preprocess_field to style the buttons (class, icon, popup text).
  3. 3. class TrainingNodeEventMigration extends DrupalNode6Migration { public function __construct(array $arguments) { parent::__construct($arguments); } protected function query() { // Pull in the default parent query and add our own join to it. $query = parent::query(); // Join the location tables, as they're not CCK, so migrate can't see them by // itself. These fields will now appear in the d2d ui. $query->join('location_instance', 'i', 'i.nid = n.nid AND i.vid = n.vid'); $query->join('location', 'l', 'l.lid = i.lid'); $query->fields('l', array('name', 'street', 'additional', 'city', 'province', 'postal_code', 'country', 'latitude', 'longitude', 'source')); return $query; } ...
  4. 4. public function prepareRow($row) { // Date value2 is the end time. $event_date = strtotime($row->{'field_date:value2'}); $now = strtotime('now'); if ($now > $event_date) { // This excludes the node. return FALSE; } // Everything else is allowed. return TRUE; }

×