Drupal Learning Journal 23. Drupalcamp, day 2, morning

The morning sessions of the Drupalcamp at Stanford is over and I am rushing to write it up before the afternoon sessions are starting.

First I attended Harris Rashid’s (another Chapter Three employee) Theme preprocess functions in template.php” session about “How to intercepts data coming from core and modules and customize them for your own needs.”

  • It was a very hands on session, going through customizing both a node.php and template.php and deconstructing the $content variable
  • Started off with Acquia Prospero theme.
  • Tools used: devel module, admin module, firebug, “Basic” theme (started, based on the Zen theme)
  • Example: Overriding: $submitted in template.php
    – look for “theme_node_submitted” function in node.module
    – copy the function from there to template.php and change it
  • Always override, never change a core module
  • Use dpm($vars) (drupal print message) from the “Devel module” that prints out the all the variable what’s available in node
  • http://api.drupal.org/api/function/check_plain – useful to sanitize content coming from users
  • There was much more, but without I didn’t manage to copy the code form screen and without that it doesn’t make much sense to post more here.

The second session I attended this morning was Sean Lange‘s “Using Panels to Make Smarter Pages” One of these days I will just need to sit down and play with Panels myself. Till then it doesn’t make much sense to make notes of the steps involved. Instead I just mention some highlights that I want to remember for the future.

  • An older version of Sean’s slides are available both from the Drupalcamp site and from his own at seanlange.com.
  • His professional site also has good content: http://webthingee.com/
  • We went through creating panels for his imaginary “Heroes of Badcamp” site.
  • Use “selection rules” for defining what type of nodes should have the panes specified.
  • Different panels are called “variants.” Drupal follows them in order: the first one on the appropriate list is executed.
  • Advantage of having a panel with a single pane: if users click the “edit” button, they can edit only the top part. The dynamic or view part under it is left untouched.
  • Draggable views” implements a weighing system, making “rows of a view “draggable” which means that they can be rearranged by Drag’n’Drop” by the users.
  • Each pane can have a visibility rule, by user role and/or node type.
  • The biggest evolution for Panels in Drupal 7 is “In-place editing”
  • We didn’t get to what I’d call “smarter” pages, but I still learned a lot of new functionality.

3 Comments

  1. George Por

    Can Drupalcamp and the loose network of other “camps” be the new University?
    Maybe, except they don’t give a diploma…

    • Learning and doing Drupal is using very different part of my brain than studying liberal arts and thinking about social and religious issues and concepts. I enjoy solving technical challenges and building great and useful sites. But they are not the same as trying to understand how people represent themselves and their ideas and religions online.

  2. Pingback: Drupal Camp Stanford University 2012, Sessions, modules, performance

Leave Comment

Your email address will not be published. Required fields are marked *