<?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 &#187; Drupal</title>
	<atom:link href="http://www.lisasawin.com/category/drupal/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>Mon, 07 Jun 2010 20:30:12 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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 [...]]]></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>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, [...]]]></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 [...]]]></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 [...]]]></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>
	</channel>
</rss>
