<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:iweb="http://www.apple.com/iweb" version="2.0">
  <channel>
    <title></title>
    <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Blog.html</link>
    <description>I’ve never wanted a blog. But after be repeated hassled for not sharing the Drupal knowledge that lives in my brain, I have created this site. &lt;br/&gt;&lt;br/&gt;If you have any comments or questions, you can email me at maureen underscore lyons at mac dot com.</description>
    <generator>iWeb 2.0.2</generator>
    <image>
      <url>http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2007/10/20_HarvardScience_Goes_Live_files/Picture%208.png</url>
      <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Blog.html</link>
    </image>
    <item>
      <title>Thinking about content types&#13;</title>
      <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types.html</link>
      <guid isPermaLink="false">a51f9baf-1508-44a2-9a45-be716ef2c2d2</guid>
      <pubDate>Mon, 28 Apr 2008 13:57:39 -0400</pubDate>
      <description>&lt;a href=&quot;http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types_files/Picture%208.png&quot;&gt;&lt;img src=&quot;http://www.maureensmusings.com/Maureen_Lyons/Blog/Media/Picture%208.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:113px; height:113px;&quot;/&gt;&lt;/a&gt;If you've ever built a reasonably complicated site, you've likely experienced the joy of pondering content types. Frequently raised questions  are: Should this thing be it's own content type? Or is it really just a field as part of another content type? And don't get me started on the is this really a taxonomy line of questioning.&lt;br/&gt;&lt;br/&gt;So in planning the new and improved Harvard Stem Cell Institute (HSCI) site, I opened up OmniGraffle and started mapping out what types of things make up the institute. I made a list of the more concrete things that make up the institute and another list of things that were incidentally created by HSCI's actions. I call the the first group the &quot;HSCI Entities&quot; because they make up the heart of the institute, and the second &quot;Supporting Content Types&quot; because they are important on the site only as they relate to the entities. For example, it doesn't make sense to post a media link from the Boston Globe if it doesn't relate to any of HSCI's people, program, grants, or events.&lt;br/&gt;&lt;br/&gt;I then added a fifth entity called &quot;topic.&quot; I wanted to create a way of viewing everything that had to do with &quot;diabetes&quot; for example, including both entities and supporting content. Why didn't I use a taxonomy for this? Well I wanted to create an easy way to theme the page template for each term and also add fields (such as a banner image) to topics.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Once I knew how the entities were different from the supporting content types I added a node reference field to each supporting content type could reference an entities. That's why in the diagram the arrows point in that direction. It makes more sense from a content creation workflow perspective to add the relationship in this direction. When I'm adding a new press release, I want to add that it's about these three people. I don't want to go to those three people nodes a add the press release. But I do want the relationship to show up on both ends, which requires some views and theming that I'll get to later.&lt;br/&gt;&lt;br/&gt;In addition to supporting content types and entities relating to each other, all of the entities and and relate to each other. And that brings me to the star diagram. Each arrow represents a relationship - the field living in one entity and pointing at the other. For example, when I create an event node, I can add that a specific person related. Or when I create a person node, I can add a topic in which they are interested. So I created a field named for each of these content types and set the node reference settings to only allow that same content type to be referenced. I then added the field to the content type that the arrow begins with. For example I created a field called &quot;program&quot; that could only reference programs and added it to the event content type; and I added this same field to grant.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;I should mention that this site is more like a &quot;public face&quot; site, where only a small handful of people will ever log-in to create or edit content. Therefore I could have &quot;person&quot; as a CCK content type rather than getting involved with user stuff.&lt;br/&gt;&lt;br/&gt;Finally, I decided that not all supporting content types are created equal, and put them into two groups: &quot;articles&quot; and &quot;media and resources.&quot; This was so I could add one more node reference field that would allow me to say for instance, &quot;this video is related to this press release.&quot; I set the field up so that it could only reference the media and resources content types and added it to the three article types.&lt;br/&gt;&lt;br/&gt;The next challenge was getting all these relationships to show-up in both directions. Half of the relationship can be printed directly into a node template, but the other half needs a view &lt;br/&gt;with the argument set to the node reference field. So I did just that, and added a view for the reverse of each node-reference.&lt;br/&gt;I wanted to embed these views into the appropriate node templates rather than display them as blocks for a slew of neurotic reasons that I'm not going to get into. But it was here that I discovered an interesting theming stumbling block. In Views 1, when you were embedding a view, and wanted to first check to see if it had any rows to print out before printing it out, all could could just check if views_get_view('my_view_name') returned anything. So my if statement would look something like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;?php&lt;br/&gt;$view_name = 'MyViewName'; //name of view&lt;br/&gt;$limit = 3; // number of returns&lt;br/&gt;$view_args = array();&lt;br/&gt;$view = views_get_view($view_name);&lt;br/&gt;if ($view) {&lt;br/&gt;  print &quot;&amp;lt;p&gt;I wanted this logic so that this paragraph would print only if there were results in MyViewName&amp;lt;/p&gt;&quot;;&lt;br/&gt;  print views_build_view('embed', $view, $view_args, FALSE, $limit);&lt;br/&gt;}&lt;br/&gt;?&gt;&lt;br/&gt;&lt;br/&gt;This doesn't work anymore. It seems that views_get_view() returns all the stuff that surround the rows (like the header, footer, extra divs) even if the view has no rows to display. After spending more time in the depths of view that I think a themer really should I came up with the following:&lt;br/&gt;&lt;br/&gt;&amp;lt;?php&lt;br/&gt;$view_name = 'MyViewName'; //name of view&lt;br/&gt;$view_args = array();&lt;br/&gt;$foo = views_get_view($view_name);&lt;br/&gt;$foo_view = $foo-&gt;execute_display('default', $view_args);&lt;br/&gt;$foo_count = $events_by_person-&gt;total_rows; //you can only check the total_rows after executed_display&lt;br/&gt;&lt;br/&gt;if ($foo_count) {&lt;br/&gt;  print &quot;&amp;lt;p&gt;I wanted this logic so that this paragraph would print only if there were results in MyViewName&amp;lt;/p&gt;&quot;;&lt;br/&gt;  print $foo_view;&lt;br/&gt;}&lt;br/&gt;?&gt;&lt;br/&gt;&lt;br/&gt;So I apologize that this lengthy post is about a site that hadn't even gone live yet.  But I'm sure that there will be more to report as it evolves.&lt;br/&gt;</description>
      <enclosure url="http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types_files/Picture%208.png" length="392506" type="image/png"/>
    </item>
    <item>
      <title>The DIY jQuery Sideshow</title>
      <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_The_DIY_jQuery_Sideshow.html</link>
      <guid isPermaLink="false">f1610079-307f-4f23-bf1e-db9d7a2561d2</guid>
      <pubDate>Mon, 28 Apr 2008 13:56:15 -0400</pubDate>
      <description>&lt;a href=&quot;http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types_files/Picture%208.png&quot;&gt;&lt;img src=&quot;http://www.maureensmusings.com/Maureen_Lyons/Blog/Media/Picture%208_1.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:113px; height:113px;&quot;/&gt;&lt;/a&gt;So during the last Boston Group Drupal Meet-up, I did a show and tell about the new and improved Harvard Stem Cell Institute website; still very much in development. &lt;br/&gt;&lt;br/&gt;One of the cooler (at least I think it's cool) is a jQuery powered slideshow that I built for the home page. I know there are lots of slideshow modules and stuff out there, but just like I enjoy cooking my own cupcakes and sewing my own cloths, I like to build little widget-y things myself. The second disclaimer is that I don't consider myself a developer, so if you look at my javaScript or Drupal tpl file suggestions and find yourself cringing, you have my deepest sympathy. Finally, I put this together using Drupal 6 and the CCK and Views versions from CVS and a patched version of the imagefield module that quicksketch put out last week... which worked wonderfully for me, though sounds a bit risky, because I suppose it is.&lt;br/&gt;&lt;br/&gt;OK, on to how to add a sideshow like the &lt;a href=&quot;http://www.maureensmusings.com/Demos/Slideshow/slideshow.html&quot;&gt;one here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Step one: Create a content type called spotlight using CCK and give it three fields. Two should be text fields called slideshow_title and slideshow_caption, and the third should be an image field called slideshow_image. I set the maximum dimensions of the image to 250x250, but all you really want to do is ensure that it's a square crop and has nice resolution when scaled to 250x250;&lt;br/&gt;&lt;br/&gt;Step two: Create two list style views called slideshow_big and slideshow_small that are set to display 6 images. Set the filter show only the slideshow nodes and those that have been promoted to the front page. Add a field like the nid or title to these two guys. But you aren't going to use it because we are going to theme the hell out of them.&lt;br/&gt;&lt;br/&gt;Step three: Theme the views so that they give you the markup you need to work with the jQuery. For Drupal 6, this would mean creating the following four tpl files in your theme directory.&lt;br/&gt;&lt;br/&gt;views-view-list--slideshow_big.tpl.php&lt;br/&gt;&lt;br/&gt;&amp;lt;?php $count = 1; ?&gt;&lt;br/&gt;&amp;lt;?php foreach ($rows as $row): ?&gt;&lt;br/&gt;  &amp;lt;div class=&quot;&amp;lt;?php if ($count == 1){ print 'show'; } else{ print 'hide'; } ?&gt; image&amp;lt;?php print $count; ?&gt; big&quot;&gt;&lt;br/&gt;    &amp;lt;?php print $row?&gt;&lt;br/&gt;  &amp;lt;/div&gt;&lt;br/&gt;  &amp;lt;?php $count++; ?&gt;&lt;br/&gt;&amp;lt;?php endforeach; ?&gt;&lt;br/&gt;&lt;br/&gt;views-view-fields--slideshow_big.tpl.php&lt;br/&gt;&lt;br/&gt;&amp;lt;?php $node = node_load($row-&gt;nid) ?&gt;&lt;br/&gt;&amp;lt;img height=&quot;250px&quot; width=&quot;250px&quot; src=&quot;/&amp;lt;?php print check_plain($node-&gt;field_slideshow_image[0]['filepath']) ?&gt;&quot;&gt;&lt;br/&gt;&amp;lt;h2&gt;&amp;lt;?php print check_plain($node-&gt;field_slideshow_title[0]['value']) ?&gt;&amp;lt;/h2&gt;&lt;br/&gt;&amp;lt;p&gt;&amp;lt;?php print check_plain($node-&gt;field_slideshow_caption[0]['value']) ?&gt;&amp;lt;p&gt;&lt;br/&gt;&amp;lt;p&gt;To read more, &amp;lt;a href=&quot;/node/&amp;lt;?php print check_plain($node-&gt;nid) ?&gt;&quot;&gt;click here&amp;lt;/a&gt;&amp;lt;/p&gt;&lt;br/&gt;&lt;br/&gt;views-view-list--slideshow_small.tpl.php&lt;br/&gt;&lt;br/&gt;&amp;lt;?php $count = 1; ?&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;?php foreach ($rows as $row): ?&gt;&lt;br/&gt;  &amp;lt;img class=&quot;&amp;lt;?php if ($count == 1) {print 'highlight ';} ?&gt;image&amp;lt;?php print $count; ?&gt; small&quot; &lt;br/&gt;  height=&quot;69px&quot; &lt;br/&gt;  width=&quot;&amp;lt;?php if ($count == 6) {print '70px';} else {print '69px';} ?&gt;&quot;&lt;br/&gt;  src=&quot;/&amp;lt;?php print $row?&gt;&quot;&gt;&lt;br/&gt;  &amp;lt;?php $count++; ?&gt;&lt;br/&gt;&amp;lt;?php endforeach; ?&gt;&lt;br/&gt;&lt;br/&gt;views-view-fields--slideshow_small.tpl.php&lt;br/&gt;&lt;br/&gt;&amp;lt;?php $node = node_load($row-&gt;nid) ?&gt;&lt;br/&gt;&amp;lt;?php print check_plain($node-&gt;field_slideshow_image[0]['filepath']) ?&gt;&lt;br/&gt;&lt;br/&gt;Step 4: Embed these bad boys by adding the following to a page template specific to your home page: front-page.tpl.php. I also wrapped each one with a class.&lt;br/&gt;&lt;br/&gt;&amp;lt;div class=&quot;slideshowBigImage&quot;&gt;&lt;br/&gt;  &amp;lt;?php&lt;br/&gt;    $slideshow_big = views_get_view('slideshow_big');&lt;br/&gt;      print $slideshow_big-&gt;execute_display('default');&lt;br/&gt;  ?&gt;&lt;br/&gt;&amp;lt;/div&gt;&lt;br/&gt;&amp;lt;div class=&quot;slideshowImageBar&quot;&gt;&lt;br/&gt;  &amp;lt;?php&lt;br/&gt;    $slideshow_small = views_get_view('slideshow_small');&lt;br/&gt;    print $slideshow_small-&gt;execute_display('default');&lt;br/&gt;  ?&gt;            &lt;br/&gt;&amp;lt;/div&gt;&lt;br/&gt;&lt;br/&gt;Step 5: Include some &lt;a href=&quot;http://www.maureensmusings.com/Demos/Slideshow/style.css&quot;&gt;style&lt;/a&gt; and the &lt;a href=&quot;http://www.maureensmusings.com/Demos/Slideshow/script.js&quot;&gt;script&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;And I think that's it.&lt;br/&gt;&lt;br/&gt;How do you do this in D5? Steps 1, 2, and 5 are the same. In step 4, you need to theme each view using D5 techniques (I always used the views theme wizard). And in step 5 you again need to embed the the views into the home page using D5 techniques: &lt;a href=&quot;http://drupal.org/node/47417&quot;&gt;http://drupal.org/node/47417&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;So it's cool to add someone else's little sideshow thingy to your site, but it's even more fun to build your own. The anatomy of something like this is straightforward markup with specific classes, some styles, and a little jQuery. Then you use your theming skills to have CCK and Views deliver the dynamic content. So take apart what I've done, revamp the scripts and styles, and make it your own -- and that’s what DIY is all about.&lt;br/&gt;</description>
      <enclosure url="http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types_files/Picture%208.png" length="392506" type="image/png"/>
    </item>
    <item>
      <title>The Lava Lamp</title>
      <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_The_Lava_Lamp.html</link>
      <guid isPermaLink="false">457db984-6554-4b4f-8f5f-145ea0f18fc2</guid>
      <pubDate>Mon, 28 Apr 2008 13:48:30 -0400</pubDate>
      <description>&lt;a href=&quot;http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types_files/Picture%208.png&quot;&gt;&lt;img src=&quot;http://www.maureensmusings.com/Maureen_Lyons/Blog/Media/Picture%208_2.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:113px; height:113px;&quot;/&gt;&lt;/a&gt;Though the new Stem Cell and Regenerative Medicine site had not gone live yet, I wanted to post the jQuery for my silly little lava lamp animation.&lt;br/&gt;&lt;br/&gt;You can view it &lt;a href=&quot;http://www.maureensmusings.com/Demos/LavaLamp/lavalamp.html&quot;&gt;here&lt;/a&gt;, get the &lt;a href=&quot;http://www.maureensmusings.com/Demos/LavaLamp/style.css&quot;&gt;styles&lt;/a&gt; here, and the &lt;a href=&quot;http://www.maureensmusings.com/Demos/LavaLamp/script.js&quot;&gt;script&lt;/a&gt; here.&lt;br/&gt;&lt;br/&gt;It's pretty similar to the the DIY Slideshow in that you just need to theme a view so that it gives you the mark-up you need. Details on how to do this were in my slides from Drupalcon, which you can get &lt;a href=&quot;Entries/2008/2/26_Maureen_Lyons%253A_%25E2%2580%259CConverting_Mockups_to_Drupal_Themes%25E2%2580%259D_at_DrupalCon_Boston_2008.html&quot;&gt;here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Rip it apart and make it your own. And let me know what happens.&lt;br/&gt;&lt;br/&gt;Cheers.&lt;br/&gt;</description>
      <enclosure url="http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/4/28_Thinking_about_content_types_files/Picture%208.png" length="392506" type="image/png"/>
    </item>
    <item>
      <title>Maureen Lyons: “Converting Mockups to Drupal Themes” at DrupalCon Boston 2008</title>
      <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/2/26_Maureen_Lyons%3A_%E2%80%9CConverting_Mockups_to_Drupal_Themes%E2%80%9D_at_DrupalCon_Boston_2008.html</link>
      <guid isPermaLink="false">a310ac58-fbda-4f57-9879-62c640949500</guid>
      <pubDate>Tue, 26 Feb 2008 20:22:09 -0500</pubDate>
      <description>I’m thrilled to report that I was selected to give a presentation on “Converting Mockups to Drupal Themes” at DrupalCon Boston. I’ve been pounding away at the slides, and will post them here once they’ve been finalized. But to be honest, that might not be until the day of my talk... which looks like it’s going to be Monday, March 3rd at 1:30pm.&lt;br/&gt;&lt;br/&gt;Update: You can download my presentation. &lt;a href=&quot;Entries/2008/2/26_Maureen_Lyons%253A_%25E2%2580%259CConverting_Mockups_to_Drupal_Themes%25E2%2580%259D_at_DrupalCon_Boston_2008_files/drupalconboston.pdf&quot;&gt;drupalconboston.pdf&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;The goal of this session is describe a practical workflow for how to approach turning a mock-up into a theme using design and user requirements as sign posts. Theming is often an inefficient process and full of gut instinct decisions, and I’m hoping that this session will help folks more quickly and confidently achieve their theming goals.&lt;br/&gt;&lt;br/&gt;Hope to see you there! &lt;br/&gt;&lt;br/&gt;P.S. There just might be some cupcakes...</description>
    </item>
    <item>
      <title>Boston Drupal Meet-up and Drupal and Vegan Cupcakes Take Over the World</title>
      <link>http://www.maureensmusings.com/Maureen_Lyons/Blog/Entries/2008/2/25_HarvardScience_Goes_Live_2.html</link>
      <guid isPermaLink="false">e4ab9cf7-efaf-49fd-9ea4-fe7d951471a0</guid>
      <pubDate>Mon, 25 Feb 2008 20:49:22 -0500</pubDate>
      <description>It was a great to see some Boston Drupal folks last week and here all about the interesting things they’re working on. The meet-ups happen about once a month, so if your in the Boston area make sure you checkout the “wicked pissah drupal usah group” at &lt;a href=&quot;http://groups.drupal.org/boston&quot;&gt;http://groups.drupal.org/boston&lt;/a&gt;. &lt;br/&gt;&lt;br/&gt;I also had a good time making chocolate-vegan cupcakes in honor of Drupal 6. In case you’re interested the recipe is from “&lt;a href=&quot;http://www.amazon.com/Vegan-Cupcakes-Take-Over-World/dp/1569242739/sr%253D1-1/qid%253D1167959896/ref%253Dpd_bbs_sr_1/102-8398920-4418538%253Fie%253DUTF8%2526s%253Dbooks&quot;&gt;Vegan Cupcakes Take Over the World&lt;/a&gt;,” but you can find the recipe for the ones I made &lt;a href=&quot;http://www.chow.com/recipes/10794&quot;&gt;here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Perhaps I will bribe people to come to my session with cupcakes... any takers?</description>
    </item>
  </channel>
</rss>
