<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>So Many Fish</title>
	<atom:link href="http://www.lisasawin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lisasawin.com</link>
	<description>...which is pretty cool when you think about it...</description>
	<lastBuildDate>Fri, 26 Aug 2011 01:16:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Custom template for block</title>
		<link>http://www.lisasawin.com/2011/08/25/custom-template-for-block/</link>
		<comments>http://www.lisasawin.com/2011/08/25/custom-template-for-block/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 01:15:08 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=171</guid>
		<description><![CDATA[I&#8217;m using Node Blocks to create blocks for a bunch of different content types and I thought I needed to theme the block template on a per content type basis. Turns out I don&#8217;t, but it took me a long time to figure out so I wanted to record it for posterity. You can actually [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://drupal.org/project/nodeblock">Node Blocks</a> to create blocks for a bunch of different content types and I thought I needed to theme the block template on a per content type basis.  Turns out I don&#8217;t, but it took me a long time to figure out so I wanted to record it for posterity.  You can actually use this technique to make a new block template with any logic you&#8217;d like.  Any data you can grab in <a href="http://api.drupal.org/api/drupal/modules--block--block.module/function/template_preprocess_block/7">template_preprocess_block</a> is up for grabs.  Then, add your template name to the theme_hook_suggestions array:</p>
<p><code>function template_preprocess_block(&amp;$variables, $hook) {<br />
  $variables['theme_hook_suggestions'][] = 'block__custom';<br />
}</code></p>
<p>Your custom template should have the name block&#8211;custom.tpl.php. This is in Drupal 7, BTW.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2011/08/25/custom-template-for-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending the Context Module</title>
		<link>http://www.lisasawin.com/2010/08/07/extending-the-context-module/</link>
		<comments>http://www.lisasawin.com/2010/08/07/extending-the-context-module/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 13:44:28 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=167</guid>
		<description><![CDATA[I needed a slight extension of the Context module. Treehouse Agency wrote up a great explanation of how they extended context_condition to create two new conditions. I&#8217;m doing pretty much the same thing, but my condition is slightly different so I thought it might benefit somewhat to see another slant on this. My site has [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a slight extension of the <a href="http://drupal.org/project/context">Context module</a>.  <a href="http://treehouseagency.com/blog/neil-hastings/2010/04/14/joy-extending-context">Treehouse Agency</a> wrote up a great explanation of how they extended context_condition to create two new conditions.  I&#8217;m doing pretty much the same thing, but my condition is slightly different so I thought it might benefit somewhat to see another slant on this.  </p>
<p>My site has a vocabulary for event categories. The vocabulary has  a hierarchy<br />
 which is one deep.  For one of the parents, &#8220;Kids Programs&#8221;, I needed to be able to establish a different look &#038; feel on each node view.  I set this up via context, using node type event and path &#8220;kids/events/*&#8221; vs path &#8220;events/*&#8221; to establish the difference. That worked great until I got to the comment pages.  I wanted a user who was commenting on an event to maintain the same context, even while on &#8220;comment/reply/nid&#8221;.  So, I created a condition to check if a node was an event and if it had a category which was within Kids Programs.  Then, I had this condition be checked via both hook_nodeapi and hook_form_comment_form_alter, which allow the context be set for all flavors of node viewing.</p>
<p>Here&#8217;s where I use the hook hook_context_plugins</p>
<p><code>/**<br />
 * Implementation of hook_context_plugins().<br />
 */<br />
function events_context_conditions_context_plugins() {<br />
  $plugins = array();<br />
  $plugins['events_context_conditions_context_condition_kids_event'] = array(<br />
    'handler' =&gt; array(<br />
      'path' =&gt; drupal_get_path('module', 'events_context_conditions'),<br />
      'file' =&gt; 'events_context_conditions_context_condition_kids_event.inc',<br />
      'class' =&gt; 'events_context_conditions_context_condition_kids_event',<br />
      'parent' =&gt; 'context_condition',<br />
    ),<br />
  );<br />
  return $plugins;<br />
}</code></p>
<p>Next you have to tell Context about your new condition, using hook_context_registry:</p>
<p><code>/**<br />
 * Implementation of hook_context_registry().<br />
 */<br />
function events_context_conditions_context_registry() {<br />
          return array(<br />
            'conditions' =&gt; array(<br />
              'kids_event' =&gt; array(<br />
                'title' =&gt; t('Custom Condition: Event node page'),<br />
                'plugin' =&gt; 'events_context_conditions_context_condition_kids_event',<br />
              ),<br />
            ),<br />
          );<br />
        }</code></p>
<p>Now we write our new class, events_context_conditions_context_condition_kids_event, extending condition_context. The class has two values, 1 means the node is tagged with at least one kids program, 2 means it isn&#8217;t.</p>
<p><code>class events_context_conditions_context_condition_kids_event extends context_condition {<br />
  function condition_values() {<br />
    $values = array(<br />
      1 =&gt; t('Event of type node in a Kids Program category'),<br />
      2 =&gt; t('Event of type node not in any Kids Program category'));<br />
    return $values;<br />
  }</p>
<p>  function execute($node) {<br />
    //If node is an event and has any kids program terms, then meet value 1<br />
    //If node is an event and has no kids program terms, then meet value 2</p>
<p>    //If the node is not an event, then you are done<br />
    if($node-&gt;type == 'event'){<br />
      //Assume there are no kids program terms, then set this to 1 if you find one.<br />
      $kids = 2;<br />
      //First gather all the terms in the event category vocabulary<br />
      $cats = taxonomy_node_get_terms_by_vocabulary($node, 4);<br />
      foreach ($cats as $cat) {<br />
        //This is the Kids Program term itself<br />
        if($cat-&gt;tid == '19') {<br />
          $kids = 1;<br />
        } else {<br />
          //Get all the parents of this term<br />
          $parents = taxonomy_get_parents($cat-&gt;tid);<br />
          if($parents){<br />
            //Check each parent to see if it is the Kids Program category<br />
            foreach($parents as $parent) {<br />
              if ($parent-&gt;tid == '19'){<br />
                $kids = 1;<br />
              }<br />
            }<br />
          }<br />
        }<br />
      }<br />
      foreach ($this-&gt;get_contexts($kids) as $context) {<br />
        $this-&gt;condition_met($context,$kids);<br />
      }<br />
    }<br />
  }<br />
}</code></p>
<p>The only thing left is to make sure this condition gets checked whenever we might be displaying a node:</p>
<p><code><br />
/**<br />
* Implementation of hook_nodeapi().<br />
*/<br />
function events_context_conditions_nodeapi(&amp;$node, $op, $teaser, $page) {<br />
  if ($op == 'view' &amp;&amp; $page) {<br />
    if (module_exists('taxonomy')) {<br />
      if ($plugin = context_get_plugin('condition', 'kids_event')) {<br />
        $plugin-&gt;execute($node);<br />
      }<br />
    }<br />
  }<br />
}</p>
<p>/**<br />
 * Implementation of hook_form_alter() for comment_form.<br />
 */<br />
function events_context_conditions_form_comment_form_alter(&amp;$form, $form_state) {<br />
  if ($nid = $form['nid']['#value']) {<br />
    if (module_exists('taxonomy')) {<br />
      if ($plugin = context_get_plugin('condition', 'kids_event')) {<br />
        $plugin-&gt;execute(node_load($nid));<br />
      }<br />
    }<br />
  }<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/08/07/extending-the-context-module/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add Individual Event to Calendar</title>
		<link>http://www.lisasawin.com/2010/06/07/add-individual-event-to-calendar/</link>
		<comments>http://www.lisasawin.com/2010/06/07/add-individual-event-to-calendar/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 20:11:53 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=148</guid>
		<description><![CDATA[A Drupal site I&#8217;m working on requires links for each event that would add the event to the user&#8217;s calendar. I&#8217;d like to provide this functionality for iCal, Outlook and Google. Drupals Calendar module offers something similar out of the box&#8211;there&#8217;s a feed which can deliver a an ics file on a per-day basis. I [...]]]></description>
			<content:encoded><![CDATA[<p>A Drupal site I&#8217;m working on requires links for each event that would add the event to the user&#8217;s calendar.  I&#8217;d like to provide this functionality for iCal, Outlook and Google.  Drupals Calendar module offers something similar out of the box&#8211;there&#8217;s a feed which can deliver a an ics file on a per-day basis.  I found some <a href="https://drupal.org/node/742146">great instructions</a> on how to deliver the ics for a single node.  This method handles repeating event really well, but I just can&#8217;t make it deal with all-day events.  No matter how I set my all day events up, the ics file delivers a start and end time.   I&#8217;ll keep digging and hopefully find a solution.  </p>
<p>To add the event to a Google calendar, I wrote a little code in my template.php file.  Here&#8217;s my code, combined with the code from above to handle the single node ics feed:</p>
<p><code>function THEME_preprocess_node(&amp;$vars, $hook) {<br />
  if ($vars['type'] == 'event') {<br />
    $node = $vars['node'];<br />
    $ics_link = "/calendar-single_ev_date/ical/".$node-&gt;nid;<br />
    $from = strtotime($node-&gt;field_ev_date[0]['value']);<br />
    $to = strtotime($node-&gt;field_ev_date[0]['value2']);<br />
    $event_title = str_replace(' ','+',$node-&gt;title);<br />
    $from_date = date('Ymd',$from);<br />
    $to_date = date('Ymd',$to);<br />
    $from_time_EST = date('His',strtotime($node-&gt;field_ev_date[0]['value']." UTC"));<br />
    $to_time_EST = date('His',strtotime($node-&gt;field_ev_date[0]['value2']." UTC"));<br />
    if ($from_time_EST == '000000' &amp;&amp; $to_time_EST == '000000') {<br />
      $google_link =<br />
'http://www.google.com/calendar/event?action=TEMPLATE&amp;text='.<br />
$event_title.'&amp;dates='.$from_date.'/'.<br />
$to_date.'&amp;<br />
location=CUSTOMER&amp;trp=false&amp;sprop=website:www.example.org&amp;'.<br />
'sprop;=name:CUSTOMER';<br />
    }else{<br />
      $from_time = date('His',$from);<br />
      $to_time = date('His',$to);<br />
      $google_link =<br />
'http://www.google.com/calendar/event?action=TEMPLATE&amp;text='.<br />
$event_title.'&amp;dates='.$from_date.'T'.$from_time.<br />
'Z/'.$to_date.'T'.$to_time.<br />
'Z&amp;location=CUSTOMER&amp;trp=false&amp;'.<br />
'sprop=website:www.example.org&amp;sprop;=name:CUSTOMER';<br />
    }<br />
    $repeat_string = $vars['node']-&gt;content['field_ev_date']['field']['#children'];<br />
    $regex = '/^&lt;div&gt;(.*?)&lt;\/div&gt;/';<br />
    $matches = array();<br />
    if (preg_match($regex, $repeat_string, $matches)) {<br />
      $search_strings = array('Repeats',' .','     ',' ');<br />
      $replace_strings = array('repeats','.','+','+');<br />
      $repeat_string =<br />
'&amp;details=Note:+This+event+'.str_replace($search_strings, $replace_strings, $matches[1]).'<br />
++Google+Calendar+does+not+allow+us+to+set+up+this+repeat+for+you.<br />
++Please+use+the+Repeats+button+above+to+do+so,+if+desired.';<br />
      $google_link .= $repeat_string;<br />
    }<br />
    $vars['add_to_ical']    = "<a href='".$ics_link."'>iCal</a>";<br />
    $vars['add_to_outlook'] = "<a href='".$ics_link."'>Outlook</a>";<br />
    $vars['add_to_google']  = '<a href="'.$google_link.'" target="_blank">&lt;img src="http://www.google.com/calendar/images/ext/gc_button1.gif" border=0&gt;</a>';<br />
  }<br />
}</code></p>
<p>Google has a <a href="http://www.google.com/googlecalendar/event_publisher_guide_detail.html">great API</a> on how to use this functionality.  It handles all day events perfectly, but doesn&#8217;t seem to have any way to deal with repeating events, despite the &#8220;All day&#8221; checkbox you get on their site.  I put a note for the user in the description box, which is unideal but will have to do.</p>
<p>We&#8217;re going to add some icons for iCal and Outlook, and we&#8217;ll be pretty much set.</p>
<p>Hey <a href="http://jamesboncek.com/">James</a>, thanks for your help with this!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/06/07/add-individual-event-to-calendar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search Form restricted to particular node type, in a block.</title>
		<link>http://www.lisasawin.com/2010/04/27/search-form-restricted-to-particular-node-type-in-a-block/</link>
		<comments>http://www.lisasawin.com/2010/04/27/search-form-restricted-to-particular-node-type-in-a-block/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 17:25:55 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=135</guid>
		<description><![CDATA[A site I&#8217;m working on has quite a few search forms. Basically, for each of the node types, we want to give the user an easy option to restrict search to only that type, ie events, blog posts, as well as a few custom content types. Sometimes the node types will be presented by taxonomy [...]]]></description>
			<content:encoded><![CDATA[<p>A site I&#8217;m working on has quite a few search forms.  Basically, for each of the node types, we want to give the user an easy option to restrict search to only that type, ie events, blog posts, as well as a few custom content types.  Sometimes the node types will be presented by taxonomy term, so that the user should be able to easily search through events tagged &#8220;toddler,&#8221; for example.  Here&#8217;s how to construct these search boxes and place them into blocks.</p>
<p>First, construct a view which lists all of the content you&#8217;d like to search together.  For example, I&#8217;ve created a view called Event List.  In it, I filter based on node type == event.  I add another filter from the Search group, &#8220;Search:  Search Terms&#8221;.  This filter is exposed and optional.  On &#8220;empty input&#8221;, select &#8220;Show All&#8221;.  I created an argument for the taxonomy term and also choose a few fields.  Then, I created a page view and gave it the path &#8220;events/%&#8221;.  In the Basic Settings fieldset, change the setting &#8220;Exposed form in block&#8221; to &#8220;yes.&#8221;   Save!</p>
<p>Now, when you go to the Blocks page, you&#8217;ll see a block called &#8220;Exposed form:  Events-page_1&#8243; (or something nicer if you name your page).  You can just drag it to a sidebar for testing, but later on you&#8217;ll probably want to restrict where this block appears.  </p>
<p>When the block is displayed on /events/all, it searches all events.  When it is displayed on events/toddlers, it only searches within events tagged toddlers.  Just what we wanted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/04/27/search-form-restricted-to-particular-node-type-in-a-block/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Context and Menu Trail to establish subnavigation by taxonomy term</title>
		<link>http://www.lisasawin.com/2010/04/22/using-context-and-menu-trail-to-establish-subnavigation-by-taxonomy-term/</link>
		<comments>http://www.lisasawin.com/2010/04/22/using-context-and-menu-trail-to-establish-subnavigation-by-taxonomy-term/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 23:51:27 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=129</guid>
		<description><![CDATA[Context is a great module, but the settings page is a little misleading. You can set a context to operate when a node tagged with a term. You can set as a reaction that one of your menu items is made active. However, when you navigate to the page for that node with the menu [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://drupal.org/project/context">Context</a> is a great module, but the settings page is a little misleading.  You can set a context to operate when a node tagged with a term.  You can set as a reaction that one of your menu items is made active.  However, when you navigate to the page for that node with the menu loaded into a block, the active item is not indicated.  Works fine if the menu is on the main part of the page, but not in a block.  This is true for any menu &#8212; primary, secondary or custom.</p>
<p>We&#8217;re working on a site which has the subnavigation in a sidebar.  It&#8217;s going to be used in a lot of different ways, but the simplest use case on this site is a blog, split into four categories.  Each category will be treated as its own mini-blog. The four categories will be in the sidebar.  When you&#8217;re viewing a post in the Book blog, then the Book link should be active in the sidebar.  </p>
<p>It turns out this is really easy to do if you use <a href="http://drupal.org/project/menutrails">Menu Trails</a>, in addition to Context.  Let context set up the display of the block holding the menu, but then associate each category with the correct menu item in Menu Trail.  Together, they will present the menu when you want it and highlight the correct link.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/04/22/using-context-and-menu-trail-to-establish-subnavigation-by-taxonomy-term/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Drupal Multisites as Git Submodules</title>
		<link>http://www.lisasawin.com/2010/03/15/configuring-drupal-multisites-as-git-submodules/</link>
		<comments>http://www.lisasawin.com/2010/03/15/configuring-drupal-multisites-as-git-submodules/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 14:01:09 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=115</guid>
		<description><![CDATA[After thinking about the set up in my previous post, I decided that I wanted a good way to push changes from the dev to the production site. So, I found Simon Hamner&#8217;s post on using submodules for this and made some modifications. I also got the whole setup working with 3 sites, dev.my-project.local, my-project.local [...]]]></description>
			<content:encoded><![CDATA[<p>After thinking about the set up in <a href='http://www.lisasawin.com/2010/03/09/setting-up-drupal-multisites-under-passenger-with-git/'>my previous post</a>, I decided that I wanted a good way to push changes from the dev to the production site.  So, I found <a href='http://www.simonhanmer.com/using_git_control_drupal_multi_site_setup'>Simon Hamner&#8217;s post</a> on using submodules for this and made some modifications.  I also got the whole setup working with 3 sites, dev.my-project.local, my-project.local and www.my-project.com.<br />
<span id="more-115"></span><br />
First, I set my server with a folder called git which will hold the bare repository for my application in git/drupal and the repository for my sites called git/sites:<br />
<code>$ mkdir git<br />
$ cd git<br />
$ cd sites<br />
$ git init</code></p>
<p>I added settings.php to a .gitignore file and checked the whole thing in to master, because I don&#8217;t ever want my sites folders to track the settings for a given location. Then, I moved up the sites code I developed earlier and checked it into a dev and production branch in git/sites.  I created the bare repository for git/drupal now too.</p>
<p>Then, I went back to my local machine and removed the sites I had developed.  I added them in as submodules instead:<br />
<code>$ git submodule add ssh://&amp;lt;snip&amp;gt;/git/sites sites/dev.my-project.local<br />
$ git submodule add ssh://&amp;lt;snip&amp;gt;/git/sites sites/my-project.local<br />
$ git submodule init</code></p>
<p>I made sure that each site was tracking the right branch and then checked the changes into the application branch of my project.  Next, I added the remote repository:<br />
<code>$ git remote add origin ssh://&amp;lt;snip&amp;gt;/git/drupal<br />
$ git push origin master<br />
$ git push origin modules-and-themes<br />
$ git push origin application</code></p>
<p>Now, I&#8217;m ready to clone this onto my host machine<br />
<code>$ git clone -l git/drupal/ production<br />
$ cd production<br />
$ git fetch<br />
$ git checkout -b  modules-and-themes<br />
$ git rebase origin/modules-and-themes<br />
$ git checkout -b application<br />
$ git rebase origin/application</code></p>
<p>and check in its application<br />
<code<br />
$ git submodule add ssh://&lt;snip&gt;/git/sites sites/www.my-project.com<br />
$ git submodule init<br />
</code></p>
<p>I pushed this up and pulled it down to my local machine, so now both repositories know all about my three sites.  I will only serve the two local sites locally and the www.my-project.com from my host, but I can live with that.  I like that I can work on the two branches (dev and production) on the various sites, merge changes and commit the results as submodules into the application branch of my Drupal site.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/03/15/configuring-drupal-multisites-as-git-submodules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Drupal multisites under Passenger, with Git</title>
		<link>http://www.lisasawin.com/2010/03/09/setting-up-drupal-multisites-under-passenger-with-git/</link>
		<comments>http://www.lisasawin.com/2010/03/09/setting-up-drupal-multisites-under-passenger-with-git/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 18:46:10 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=94</guid>
		<description><![CDATA[Here&#8217;s my steps for setting up a Drupal production and development site, with Drupal core and modules under separate Git control and running the whole thing under Passenger. I got most of this framework from Version Control Blog, but instead of using separate repositories for Drupal core and modules, I use branches. In addition, I [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my steps for setting up a Drupal production and development site, with Drupal core and modules under separate Git control and running the whole thing under Passenger.  I got most of this framework from <a href='http://www.versioncontrolblog.com/2007/08/02/upgrading-drupal-52-with-git/'>Version Control Blog</a>, but instead of using separate repositories for Drupal core and modules, I use branches.  In addition, I include the details of my Passenger setup.</p>
<p>One thing I really like about how <a href='http://www.versioncontrolblog.com'>Version Control Blog</a> illustrates this process, is setting up the project with an older version of Drupal and then upgrading at the end, to show how simple it is.  I will definitely follow that path.<br />
<span id="more-94"></span><br />
So, to begin with, create a folder with a fresh download of Drupal and commit it to Git.  At the command line:</p>
<p><code>$ drush dl drupal-6.15<br />
$ mv drupal-6.15 my-project<br />
$ cd my-project<br />
$ git init<br />
$ git add .<br />
$ git commit -m "Drupal 6.15 imported"</code></p>
<p>Now create the branch for your modules and download some modules for it:<br />
<code>$ git checkout -b "modules"<br />
$ drush dl cck<br />
$ git add .<br />
$ git commit -m "CCK 6.x-2.6 imported"<br />
$ drush dl views<br />
$ git add .<br />
$ git commit -m "Views 6.x-2.8 imported"<br />
$ git status</code></p>
<p>Now create the branch for your actual Drupal project:<br />
<code>$ git checkout -b application</code></p>
<p>Create two sites folders, one for a dev site, one for production:<br />
<code>$ mkdir sites/dev.my-projectlocal<br />
$ mkdir sites/my-project.local</code></p>
<p>Copy and rename sites/default/default.settings.php over to the two new sites folders:<br />
<code>$ cp sites/default/default.settings.php sites/dev.my-project.local/settings.php<br />
$ cp sites/default/default.settings.php sites/my-project.local/settings.php</code></p>
<p>Create the two databases in mysql:<br />
<code>mysql&gt; create database my_project;<br />
mysql&gt; create database my_project_development;</code></p>
<p>The next step is to configure Passenger to send requests for my-project.local and dev.my-project.local to our Drupal application.  For this, I need to edit my /etc/hosts file, adding these lines:<br />
<code>127.0.0.1 my-project.local<br />
127.0.0.1 dev.my-project.local</code></p>
<p>I setup Passenger via <a href='http://peepcode.com/products/phusion-passenger'>Peepcode&#8217;s Phusion Passenger screencast</a>, so my VirtualHost entry goes in a passenger_vhost.conf file and looks like this:<br />
<code>&amp;lt;VirtualHost *:80&amp;gt;<br />
    ServerName my-project.local<br />
    DocumentRoot /Library/WebServer/Documents/my-project<br />
&amp;lt;/VirtualHost *:80&amp;gt;<br />
&amp;lt;VirtualHost *:80&amp;gt;<br />
    ServerName dev. my-project.local<br />
    DocumentRoot /Library/WebServer/Documents/my-project<br />
&amp;lt;/VirtualHost *:80&amp;gt;</code></p>
<p>Don&#8217;t forget to restart your server:<br />
<code>$ sudo apachectl graceful</code></p>
<p>Now you should be able to navigate to http://my-project.local and http://dev.my-project.local and install these apps as usual.</p>
<p>When you are done, check the two sites folders into Git:<br />
<code>$ git add .<br />
$ git commit -m "Setting up development and production sites"</code></p>
<p>Don&#8217;t forget to block your webserver from exposing your Git files.  Add this line to your .htaccess file:<br />
<code>RewriteRule ^\.git - [F]</code></p>
<p>Check it into Git as well.  When I update from Drupal 6.15 to Drupal 6.16, Git nicely merges the changes to htaccess from the upgrade with my manual addition of this RewriteRule. </p>
<p>Now, here&#8217;s how to upgrade Drupal core.  I have a copy of the latest Drupal release in my Downloads directory.  I first switch back to my master branch, then copy the new Drupal files over to my project and then see what the changes are, just out of curiosity.  I add them all in to master, then checkout modules and merge master into that.  Then, I checkout application and merge modules into it.</p>
<p><code>$ git checkout master<br />
$ cp -Rf ~/Downloads/drupal-6.16/ .<br />
$ git status<br />
$  git add .<br />
$  git commit -m "Drupal 6.16 imported"<br />
$  git checkout modules<br />
$  git merge master<br />
$ git checkout application<br />
$  git merge modules</code></p>
<p>I&#8217;ll need to run the update.php script for each site, to update the databases, then I&#8217;m all set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/03/09/setting-up-drupal-multisites-under-passenger-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import from Movable Type to Drupal</title>
		<link>http://www.lisasawin.com/2010/03/03/import-from-movable-type-to-drupal/</link>
		<comments>http://www.lisasawin.com/2010/03/03/import-from-movable-type-to-drupal/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 20:17:54 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=92</guid>
		<description><![CDATA[It seems like they&#8217;re been some problems along the way with the Import Typepad / MoveableType module and Drupal 6. I had no problems with it though. I followed some, but not all of Andrew Benkard&#8217;s suggestions. Removing PRIMARY CATEGORY wasn&#8217;t necessary. I loved how the user names don&#8217;t need to match from Movable Type [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like they&#8217;re been some problems along the way with the <a href="http://drupal.org/project/import_typepad">Import Typepad / MoveableType</a> module and Drupal 6.  I had no problems with it though. I followed some, but not all of  <a href="http://www.marketingtechnician.com/blog/migrating-movable-type-drupal">Andrew Benkard&#8217;s suggestions</a>.  Removing PRIMARY CATEGORY wasn&#8217;t necessary.  I loved how the user names don&#8217;t need to match from Movable Type to Drupal&#8211;there&#8217;s a great gui for matching up the user names in Movable Type to the user names in Drupal.  This module is a huge help to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2010/03/03/import-from-movable-type-to-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Theme Developer toasts drag-n-drop in Manage Fields</title>
		<link>http://www.lisasawin.com/2009/12/09/theme-developer-toasts-drag-n-drop-in-manage-fields/</link>
		<comments>http://www.lisasawin.com/2009/12/09/theme-developer-toasts-drag-n-drop-in-manage-fields/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 13:47:34 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=87</guid>
		<description><![CDATA[My Manage Fields page within Drupal Content Management lost drag and drop-ability, which turned out to because of this javascript error: &#8216;$(&#8216;.indentation&#8217;, testCell).get(1)&#8217; [undefined] is not an object. Turning off the Theme Developer module fixed it!]]></description>
			<content:encoded><![CDATA[<p>My Manage Fields page within Drupal Content Management lost drag and drop-ability, which turned out to because of this javascript error:</p>
<blockquote><p>
&#8216;$(&#8216;.indentation&#8217;, testCell).get(1)&#8217; [undefined] is not an object.
</p></blockquote>
<p>Turning off the Theme Developer module fixed it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2009/12/09/theme-developer-toasts-drag-n-drop-in-manage-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Viewing multiple domains hosted via vhost on other computers</title>
		<link>http://www.lisasawin.com/2009/10/07/viewing-multiple-domains-hosted-via-vhost-on-other-computers/</link>
		<comments>http://www.lisasawin.com/2009/10/07/viewing-multiple-domains-hosted-via-vhost-on-other-computers/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 19:59:58 +0000</pubDate>
		<dc:creator>somanyfish</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[rails hosting]]></category>

		<guid isPermaLink="false">http://www.lisasawin.com/?p=14</guid>
		<description><![CDATA[I followed this excellent screencast on setting up Phusion Passenger and all was running well. I can now develop multiple Rails apps simultaneously without starting/stopping my WebBrick server, which I love. But how to view these apps from my networked PC&#8217;s? All it took was an entry in the hosts file, which is here by [...]]]></description>
			<content:encoded><![CDATA[<p>I followed <a href='http://peepcode.com/products/phusion-passenger'>this excellent screencast on setting up Phusion Passenger</a> and all was running well.  I can now develop multiple Rails apps simultaneously without starting/stopping my WebBrick server, which I love.  But how to view these apps from my networked PC&#8217;s?  All it took was an entry in the hosts file, which is here by default on both XP and Vista:</p>
<p>%SystemRoot%\system32\drivers\etc\</p>
<p><a href='http://en.wikipedia.org/wiki/Hosts_file#Location_and_content'>Thanks, Wikipedia!</a>  Now, on both my development machine and my others, I can use addresses like app.local to see work in progress.</p>
<p>One additional point:  in your Rails apps,  puts will write to your Apache error log, which may be located here:  /var/log/apache2/error_log.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lisasawin.com/2009/10/07/viewing-multiple-domains-hosted-via-vhost-on-other-computers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

