Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

The renovation of Machsom Watch

Parent Feed: 
One of our favorite client that we are very proud of, and we accompanied from our early days, is www.MachsomWatch.org. Lately we upgraded it from drupal 5.x to drupal 6.x and dressed it with a new beautiful design by Inbal Mizrach. As long with the design, an extreme UI process was made, what made us actually build, almost the entire site from scratch, over the existing content. One of the interesting challenge was to combine the checkpoints content with the daily reports from checkpoints. *A checkpoint* - is a description of the checkpoint with map, flickr images and videos from the checkpoint. *A daily report from the checkpoints* - is a daily report from one, two, three or more checkpoints, which tagged with those checkpoints tag. The goal was to eliminate the checkpoint page, and under it to display the latest report from that checkpoint, and to make the checkpoint as a context for paging through daily reports from that checkpoint. One more thing is to display the description, map, flickr images and embed video from the checkpoint context. Keeping the original paths of the daily reports was a must, according to the amount and their google rank. We created the check points navigation by going over the checkpoint terms and links them to the latest report from that checkpoint, while adding the tid (checkpoint) as a query to the path. Well, it looks something like that: 0 ORDER BY n.created DESC LIMIT 1 ', 'content_daily_report', $term->tid)); //Build the links with the name the term, href of from the latest report that we found //and passing the link checkpoint as url query. if ($nid) { $items[] = l($term->name, "node/" . $nid, array('query' => 'checkpoint=' . $term->tid)); } }; return theme('item-list', $items); ... ?> Now when we'll chose a checkpoint to observe it, we'll actually go to his latest daily report with the checkpoint as a context (argument in the URL). We also can use this context to grab the resources (description, map, flickr images and embed video) from the checkpoint to display in the report page. We are using this checkpoint context to browse through reports from the same context (checkpoint) by a jump menu or by their created day sorting pager. A pager can look something like this: created; $node_type = $node->type; //Get the checkpoint tid from the url query. $current_tid = $_GET['checkpoint']; //Return the prev result for the same checkpoint. $prev_res = db_result(db_query('SELECT n.nid, n.title FROM {node} n INNER JOIN {term_node} t ON n.vid = t.vid WHERE n.type = ā€œ%sā€ AND t.tid = ā€œ%sā€ AND n.status 0 AND n.created 0 AND n.created > %d ORDER BY n.created ASC LIMIT 1 ', $node_type, $current_tid, $node_created)); $urlquery = $node_type == 'content_daily_report' ? 'checkpoint=' . $_GET['checkpoint'] : NULL; if ($nid = $prev_res) { //Build the links with the name of the link, href from the prev report that we found //and passing the link checkpoint as url query. $items[] = l(t('prev'), "node/" . $nid, array('query' => $urlquery)); } else { $items[] = t('prev'); } if ($nid =$next_res) { //Build the links with the name of the link, href from the next report that we found //and passing the link checkpoint as url query. $items[] = l(t('next'), "node/" . $nid, array('query' => $urlquery)); } else { $items[] = t('next'); } return theme(checkpoint_daily_report_pager', $items); ... ?> As long as we keep getting the checkpoint query from the URL, and passing it to the next one, we are keeping the context alive.
Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web