<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.alanpeart.net"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>my name is alan - drupal</title>
 <link>http://www.alanpeart.net/taxonomy/term/15/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Looking for a Drupal themer</title>
 <link>http://www.alanpeart.net/blog/looking-drupal-themer</link>
 <description>&lt;div class=&quot;blog-left&quot;&gt;
&lt;h2 class=&quot;folio-title&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;my blog&lt;/a&gt;_Looking for a Drupal themer&lt;/h2&gt;
&lt;div class=&quot;date&quot;&gt;19.05.2011&lt;/div&gt;
&lt;div class=&quot;blog-text&quot;&gt;&lt;p&gt;The Creative Coop (who I work with) is looking for an freelance, associate Drupal developer to help us cater for the growing demand on our services. We are ideally looking for someone familiar with the full drupal installation and building cycle, but with a good attention to detail and emphasis on theming and CSS skills. Some basic PHP is necessary, but you don&#039;t have to be a wizard. You&#039;ll be working alongside me, and the role would suit someone who&#039;s interested in improving their general Drupal skills and building a portfolio.&lt;/p&gt;
&lt;p&gt;From creating authentic brands to engage people offline to making beautifully useful web tools and strategies that build communities online, The Creative Coop work alongside all sorts of social and third sector organisations as well as incubating their own projects.&lt;/p&gt;
&lt;p&gt;No agencies please. We&#039;d like to see a small portfolio of projects that demonstrate your suitability. Please include your location and expected day rates and why you think you would like to become an associate member of The Creative Coop.&lt;/p&gt;
&lt;p&gt;You can get in touch with me directly via my &lt;a href=&quot;/contact_me&quot; title=&quot;Contact Form&quot;&gt;contact form&lt;/a&gt;, or with the Creative Coop via &lt;a href=&quot;http://www.drupal.org.uk/wanted/front-end-drupal-themer/may-2011&quot; title=&quot;http://www.drupal.org.uk/wanted/front-end-drupal-themer/may-2011&quot;&gt;http://www.drupal.org.uk/wanted/front-end-drupal-themer/may-2011&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blog-tags&quot;&gt;
&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/30&quot;&gt;css&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/45&quot;&gt;developer&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/15&quot;&gt;drupal&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/43&quot;&gt;PHP&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/42&quot;&gt;theming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/44&quot;&gt;work&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-tags --&gt;
&lt;/div&gt;&lt;!-- end blog-left --&gt;
&lt;div class=&quot;blog-right&quot;&gt;
&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td class=&quot;mapicon&quot;&gt;&lt;img alt=&quot;view a larger image&quot; src=&quot;/sites/all/themes/mynameis/images/map-icon.png&quot;&gt;&lt;/td&gt;&lt;td&gt;click image to enlarge_&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;div class=&quot;blog-right-image&quot;&gt;&lt;img  class=&quot;imagefield imagefield-field_blog_image&quot; width=&quot;81&quot; height=&quot;100&quot; alt=&quot;&quot; src=&quot;http://www.alanpeart.net/sites/default/files/picture-626.jpg?1305769104&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;yellow&quot;&gt;&lt;div class=&quot;blog-teaser&quot;&gt;&lt;div class=&quot;date&quot;&gt;other recent blogs&lt;/div&gt;&lt;div class=&quot;bloglist&quot;&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/63&quot;&gt;Looking for a Drupal themer&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/62&quot;&gt;Drupal 6 Popup Forms&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/55&quot;&gt;Deleting cookies using PHP&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/53&quot;&gt;table row links in Drupal Views&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;see all blog entries&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-right --&gt;</description>
 <category domain="http://www.alanpeart.net/taxonomy/term/30">css</category>
 <category domain="http://www.alanpeart.net/category/blog-tags/developer">developer</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/15">drupal</category>
 <category domain="http://www.alanpeart.net/category/blog-tags/php">PHP</category>
 <category domain="http://www.alanpeart.net/category/blog-tags/theming">theming</category>
 <category domain="http://www.alanpeart.net/category/blog-tags/work">work</category>
 <pubDate>Thu, 19 May 2011 01:38:26 +0000</pubDate>
 <dc:creator>alan</dc:creator>
 <guid isPermaLink="false">63 at http://www.alanpeart.net</guid>
</item>
<item>
 <title>Drupal postcode proximity search</title>
 <link>http://www.alanpeart.net/blog/drupal-postcode-proximity-search</link>
 <description>&lt;div class=&quot;blog-left&quot;&gt;
&lt;h2 class=&quot;folio-title&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;my blog&lt;/a&gt;_Drupal postcode proximity search&lt;/h2&gt;
&lt;div class=&quot;date&quot;&gt;10.08.2010&lt;/div&gt;
&lt;div class=&quot;blog-text&quot;&gt;&lt;p&gt;The brief: a website built around a UK postcode search. The user inputs their postcode, chooses a category to narrow the search if they want, and the results can be displayed as a list of teasers or a GMap. The teaser list needs to be sorted either alphabetically or by distance from the entered postcode. Sounds simple, right?&lt;/p&gt;
&lt;p&gt;&lt;b&gt;WRONG&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I have always had the impression that the Views module wavers constantly between being incredibly useful and collapsing under the weight of its own complexity. I have used Views to create websites very rapidly, but likewise I have often gotten bogged down in its limitations, bugs and unexpectedly mysterious workings. Often it can be a case of getting 95% of the way there in an hour, then spending 2 days achieving the final 5%, and this was one of those times.&lt;/p&gt;
&lt;p&gt;With Drupal 6, Views, Locations and GMap all being quite mature at this point I was taken aback by the problems I encountered accomplishing what I considered to be one of the more basic possible uses of a location search. Searching on Google informed me that I was not alone.&lt;/p&gt;
&lt;p&gt;Initially I was going to write about the problems of doing a proximity search from a naked postcode, but the extremely active Drupal community have resolved this issue in the last couple of weeks. So instead I thought I would just write down a couple of the essential elements of the &quot;recipe&quot; that I have used to accomplish my postcode search site, in the hope that someone else out there might find it useful. Who knows, the next release of location or views might make all these comments completely obsolete!&lt;/p&gt;
&lt;p&gt;Most of the required functionality came right out of the box with Location Views: once I had a content type associated with a location, and built a few sample nodes, it was relatively easy to create a view listing those nodes. Using &quot;node view&quot; allowed me to style them using Content Templates. I added a location: distance/proximity argument to the view, and this took as an argument the user-entered postcode...NOT! I couldn&#039;t work out for a long time why this argument failed to work, until I realized I was missing some small grey &quot;helper text&quot; underneath the settings:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://www.alanpeart.net/sites/default/files/argument.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So, OK, I could grumble (and I did) about how this vital info was easy to miss; on the other hand, where were they supposed to put it? Oh yes, that&#039;s right - in the comprehensive, helpful documentation for Views...oh. Anyway, let&#039;s put this down to developer blindness and move on, now that we know that the postcode argument needs to be country_postcode_distance or postcode_distance (where &quot;distance&quot; is the number of miles away from the postcode to return location results for).&lt;/p&gt;
&lt;p&gt;My other argument was a category taken from a hierarchical vocabulary. I tried messing around with exposing a hierarchical-select filter in views, and very quickly ran into some horrible nightmares. To sum up, if I had done it that way there is no way I would have been able to style my form as specified by the graphic designer. So I learned how to add a hierarchical select field to my own form and passed the value of this field into the view as a simple TermID argument.&lt;/p&gt;
&lt;p&gt;Now, the user needed to be able to switch easily between Displays in the same view (i.e. viewing the same results as a GMap or a node list) and also switch between alphabetical and distance ordering. Again, after some tinkering with trying to expose filters I realized that my form was going to get very ugly very quickly, so instead what I did was create my own links by passing arguments in the URL. So to display the A-Z list, I added a display to the View whose only difference was that there was an alphabetical sort in the sort criteria, then created a link (nicely styled as specified!) in the form &lt;a href=&quot;http://mysite.com/myform?postcode=xxxxxx&amp;amp;tid=1&amp;amp;display=page_2&quot; title=&quot;http://mysite.com/myform?postcode=xxxxxx&amp;amp;tid=1&amp;amp;display=page_2&quot;&gt;http://mysite.com/myform?postcode=xxxxxx&amp;amp;tid=1&amp;amp;display=page_2&lt;/a&gt;. Then using $_GET I was able to choose which display of the view to display, and used views_embed_view($postcode, $tid, $display).&lt;/p&gt;
&lt;p&gt;This also enabled the user&#039;s choices to be retained while switching between different displays of the view, since I took the $_GET values and also used them to set the values of the form fields. And in one key respect it saved my sanity, namely: &lt;b&gt;sorting by distance.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This should have been easy. I had a view taking a postcode as its origin and calculating distance between the origin and each node listed. However, sorting by the distance proved a severe headache. Options were present to sort by distance from user location, distance from a static postcode, distance from a location-associated nid argument....the full list is here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://www.alanpeart.net/sites/default/files/sort.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What wasn&#039;t there was an option to sort by distance from my postcode argument. This one cost me about 2 hours. I quickly settled on the need to use the &quot;Use PHP code to determine latitude/longitude) option, but using standard views syntax to get the views arguments directly ($args[0], $args[1], etc) didn&#039;t work. Eventually I figured out that since in my particular case I was passing arguments in the URL, I could use $_GET here like anywhere else to get my postcode. Then I used location_get_postalcode_data() from the Location API reference to get my lat/lon pair. Lastly I just had to figure out that although that array came back in the form array(&#039;lat&#039;=&gt;xx.xx, &#039;lon&#039;=&gt;xx.xx), the return value for the sorting had to be in the form array(&#039;latitude&#039;=&gt;xx.xx, &#039;longitude&#039;=&gt;xx.xx). Live preview didn&#039;t work for this one (because of the use of $_GET) but when I saved the view and tried my form again, it worked! Here&#039;s the code:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://www.alanpeart.net/sites/default/files/php.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Incidentally, using the Location API was invaluable when I needed to access the distance/proximity value in my Content Template. Again, I used the postcode value from $_GET and passed it into location_get_postalcode_data() to get the lat/lon array. Then I passed both lat/lon arrays (the origin, and the one from $node-&gt;locations) into location_distance_between() and hey presto!&lt;/p&gt;
&lt;p&gt;These little tricks enabled me to solve my problem and provide a working postal code search facility to my client, but I&#039;m under no illusions about them being a solution flexible enough for anyone else, which is why I&#039;m not providing comprehensive code, just guidelines to other stuck developers about how they might solve their problem. Hopefully a couple more iterations of Views or Location may solve these problems. I had to find a quick and clean-as-possible solution in order to meet a deadline. I found myself caught in the nether world where Views was able to provide so much of the required functionality that it became worth it to try to hack around in search of that remaining 5% rather than coding something from scratch.&lt;/p&gt;
&lt;p&gt;None of the above should be interpreted as criticism of the developers who work on the Views and Location modules. These are incredibly complex modules which have to integrate and play nice with a number of other incredibly complex modules, and Drupal itself, so it&#039;s no wonder that there are bugs and omissions. It was actually quite exciting to find out that in the 2 weeks since I started development on my project, one of my critical bugs was fixed in a development release!&lt;/p&gt;
&lt;p&gt;That concludes my unnecessarily long summary of a developer&#039;s solution to a client request. Hopefully someone might find it useful, and if you do, a comment would make me feel all warm and fuzzy!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;EDIT #1:&lt;/b&gt;I realized I could make my life even easier by calculating latitude and longitude for the origin once (in the form submit handler) and then passing the latitude and longitude as values in the URL. This meant that instead of calling location_get_postalcode_data() 12 times (once in the form submit, once in the Views sort criteria, and once for each node teaser displayed in the View), it only gets called once. Much better.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;EDIT #2: &lt;/b&gt;Another problem became apparent in testing: the UK postcode data that ships with the Location Module is a reduced set, containing data only up to the area (in the form &#039;CO1&#039; or &#039;HG3&#039;) rather than the full set of postcode data (&#039;CO1 xxx&#039; or &#039;HG3 xxx&#039;). When I searched for the full set of UK postcode data, it became apparent why this was: there were over 2 million rows of data to import.&lt;/p&gt;
&lt;p&gt;For those interested, I found a Drupal-friendly SQL script for the full UK postcode data &lt;a href=&quot;https://drupal.org/node/765564&quot;&gt;here&lt;/a&gt; (scroll down to comment #17). However, I found this to be a problem for me. Even once I got it imported, which took quite a while due to MySQL timeouts, I found it slowed my Search page down by a factor of 10 (from average 0.5 seconds to average 5 seconds), and almost all of that time was taken up by the MySQL query used in location_get_postalcode_data(). There didn&#039;t seem to be a lot I could do in terms of optimization so I decided to revert to the reduced set of data (which provides a fairly accurate location, it just doesn&#039;t go down to the street level and therefore some distance calculations are probably slightly off).&lt;/p&gt;
&lt;p&gt;If anyone has a Drupal site, using Location, working with the full UK postcode data set, that isn&#039;t slow as a dog when searching that table, then I want to know!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;EDIT #3: &lt;/b&gt;The client raised a problem that was interesting. After searching by postcode and displaying the View as a GMap, the map was always centred by default on the same location, which was set by a GMap macro in the View settings. The client wanted the map to be centred on the postcode that had just been searched for (a totally reasonable request). However, this wasn&#039;t an option. Views offered me the ability to center on a node argument; in other words, if I passed in a nodeid, I could center the map on that node&#039;s location. This wasn&#039;t very useful to me, since I want to center on the postcode argument, not a node.&lt;/p&gt;
&lt;p&gt;One possible workaround occurred to me: on every postcode search, I can create a node, set the node&#039;s location to the searched postcode, and then pass that node id as an argument to the View. These dummy nodes could then be deleted on the next cron run. However, this kind of hack should be regarded as a last resort.&lt;/p&gt;
&lt;p&gt;I ended up settling for a much more elegant hack which I discovered &lt;a href=&quot;http://drupal.org/node/954384&quot;&gt;here&lt;/a&gt;. It involves adding 1 line of code to the GMap module which enables the GMap macro field in my view to parse PHP. Once this is done, then it&#039;s easy for me to insert some php that reads my postcode (or more accurately, my lat/lon arguments) and outputs the macro using those to center the map.&lt;/p&gt;
&lt;p&gt;Of course, now I have to remember to re-insert this line in gmap.module every time I update the GMap module, which is why hacking modules is usually a bad idea. However in this case it was worth it to me, as a) a fix was needed quickly, b) this is obvious and necessary functionality, and c) I am not being retained as the site&#039;s maintainer ;-)&lt;/p&gt;
&lt;p&gt;It&#039;s probably clear from all of the above that Drupal + Views + GMap + Location is almost, but not quite, ready for this extremely common real-world application (searching by postcode).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blog-tags&quot;&gt;
&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/15&quot;&gt;drupal&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/35&quot;&gt;location&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/37&quot;&gt;postcode&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/34&quot;&gt;views&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/25&quot;&gt;web development&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-tags --&gt;
&lt;/div&gt;&lt;!-- end blog-left --&gt;
&lt;div class=&quot;blog-right&quot;&gt;
&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td class=&quot;mapicon&quot;&gt;&lt;img alt=&quot;view a larger image&quot; src=&quot;/sites/all/themes/mynameis/images/map-icon.png&quot;&gt;&lt;/td&gt;&lt;td&gt;click image to enlarge_&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;div class=&quot;blog-right-image&quot;&gt;&lt;img  class=&quot;imagefield imagefield-field_blog_image&quot; width=&quot;1632&quot; height=&quot;1224&quot; alt=&quot;&quot; src=&quot;http://www.alanpeart.net/sites/default/files/dsc00355.jpg?1281458884&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;yellow&quot;&gt;&lt;div class=&quot;blog-teaser&quot;&gt;&lt;div class=&quot;date&quot;&gt;other recent blogs&lt;/div&gt;&lt;div class=&quot;bloglist&quot;&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/63&quot;&gt;Looking for a Drupal themer&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/62&quot;&gt;Drupal 6 Popup Forms&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/55&quot;&gt;Deleting cookies using PHP&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/53&quot;&gt;table row links in Drupal Views&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;see all blog entries&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-right --&gt;</description>
 <category domain="http://www.alanpeart.net/taxonomy/term/15">drupal</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/35">location</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/37">postcode</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/34">views</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/25">web development</category>
 <enclosure url="http://www.alanpeart.net/sites/default/files/argument.jpg" length="50238" type="image/jpeg" />
 <pubDate>Tue, 10 Aug 2010 16:50:50 +0000</pubDate>
 <dc:creator>alan</dc:creator>
 <guid isPermaLink="false">49 at http://www.alanpeart.net</guid>
</item>
<item>
 <title>Drupal update nightmares</title>
 <link>http://www.alanpeart.net/blog/drupal-update-nightmares</link>
 <description>&lt;div class=&quot;blog-left&quot;&gt;
&lt;h2 class=&quot;folio-title&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;my blog&lt;/a&gt;_Drupal update nightmares&lt;/h2&gt;
&lt;div class=&quot;date&quot;&gt;15.06.2010&lt;/div&gt;
&lt;div class=&quot;blog-text&quot;&gt;&lt;p&gt;Sometimes things go as planned, and sometimes they don&#039;t. That sentence sums up my relationship with &lt;a href=&quot;&quot; title=&quot;&quot;&gt;Drupal&lt;/a&gt;. Tonight was one of the bad times. I just finished bringing my own site up to date with the latest Drupal security release (6.17 at the time of writing), and while I was at it I decided to update all my add-on modules to their latest versions too, because why not? While I was at THAT, I realized that I hadn&#039;t put my themes and modules in the right place when I built my site - they were sitting in the core &quot;/themes&quot; and &quot;/modules&quot; directories, which is baaaaaad) - so why not move them to the right place too?&lt;/p&gt;
&lt;p&gt;So I did it all at once. But first, just to make sure the subsequent nightmare would be as annoying as possible, I overwrote my local versions of the modules with the new versions, then uploaded all the new ones to the right place on the webserver. Then I deleted the existing modules on the server.&lt;/p&gt;
&lt;p&gt;No, since you ask, I didn&#039;t take a backup first. Why would I do that? It&#039;s only MY website. Some kind of brainfart caused me to skip every single one of the standard precautions I would take 100% of the time if I was altering a client&#039;s website. I didn&#039;t back up the database. I didn&#039;t back up the files. I didn&#039;t keep a local copy of the previous files. I just nuked everything and uploaded the new stuff, because at 3am sometimes I am an idiot.&lt;/p&gt;
&lt;p&gt;Predictably, a lot of things went wrong. Allow me to list them.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Conflicts with new module versions caused my site to crap out completely with PHP errors.
&lt;ul&gt;
&lt;li&gt;Fix: deleted a module I wasn&#039;t using anyway&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The modules and themes couldn&#039;t be found after I moved them from /modules to /sites/all/modules and from /themes to /sites/all/themes. Also, because the themes couldn&#039;t be found, I couldn&#039;t navigate to admin/settings/performance to clear the cache to fix this.
&lt;ul&gt;
&lt;li&gt;Fix: navigated to admin/build/modules which although themeless was still a functional form. Saving the modules page cleared the cache and the modules were picked up again.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Lots of images in my theme didn&#039;t show up because I&#039;d hard-coded the URLs in the stylesheet and the page templates and then moved the theme.
&lt;ul&gt;
&lt;li&gt;Fix: updated CSS files and content templates with the new image paths.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Javascript gallery stopped working.
&lt;ul&gt;
&lt;li&gt;Fix: updated path to jQuery gallery in page.tpl.php&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;My hacks were lost. This was a real pain. I&#039;d forgotten that as a shortcut, I&#039;d hacked the Flickr and Twitter modules to add some extra tags for style purposes. When I updated to the new module versions, I lost all my hacks. This really was no more than I deserved, since hacking modules is NOT THE DRUPAL WAY. All right, sometimes it&#039;s the quickest and easiest way to accomplish something in a hurry, and sometimes in the real world we are in a hurry, but sometimes we pay for our hurry, and in this case it cost me another hour.
&lt;ul&gt;
&lt;li&gt;Fix: wrote better CSS this time.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;All this trouble taught me a couple of lessons which I thought I knew already, but apparently I needed to learn them again.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Put your add-on modules and themes in sites/all/modules and sites/all/themes&lt;/li&gt;
&lt;li&gt;Don&#039;t hack core. Don&#039;t hack other peoples&#039; modules - or if you absolutely must, don&#039;t forget that you&#039;ve hacked them.&lt;/li&gt;
&lt;li&gt;Always take a backup before updating anything.&lt;/li&gt;
&lt;li&gt;Don&#039;t try to do anything important on a live server after 2am.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Like I said, I stick carefully to the guidelines when working on client sites but took shortcuts for my own, with a kind of mindset that it didn&#039;t matter because the only person who&#039;d ever know was me anyway. So this is my confession to the world: I did not follow the Drupal Way, and for my penance I lost three hours of my life. I repent forevermore.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blog-tags&quot;&gt;
&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/15&quot;&gt;drupal&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/33&quot;&gt;nightmare&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-tags --&gt;
&lt;/div&gt;&lt;!-- end blog-left --&gt;
&lt;div class=&quot;blog-right&quot;&gt;
&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td class=&quot;mapicon&quot;&gt;&lt;img alt=&quot;view a larger image&quot; src=&quot;/sites/all/themes/mynameis/images/map-icon.png&quot;&gt;&lt;/td&gt;&lt;td&gt;click image to enlarge_&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;div class=&quot;blog-right-image&quot;&gt;&lt;img  class=&quot;imagefield imagefield-field_blog_image&quot; width=&quot;813&quot; height=&quot;1052&quot; alt=&quot;&quot; src=&quot;http://www.alanpeart.net/sites/default/files/munch.scream.jpg?1276569564&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;yellow&quot;&gt;&lt;div class=&quot;blog-teaser&quot;&gt;&lt;div class=&quot;date&quot;&gt;other recent blogs&lt;/div&gt;&lt;div class=&quot;bloglist&quot;&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/63&quot;&gt;Looking for a Drupal themer&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/62&quot;&gt;Drupal 6 Popup Forms&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/55&quot;&gt;Deleting cookies using PHP&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/53&quot;&gt;table row links in Drupal Views&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;see all blog entries&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-right --&gt;</description>
 <category domain="http://www.alanpeart.net/taxonomy/term/15">drupal</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/33">nightmare</category>
 <pubDate>Tue, 15 Jun 2010 03:13:38 +0000</pubDate>
 <dc:creator>alan</dc:creator>
 <guid isPermaLink="false">47 at http://www.alanpeart.net</guid>
</item>
<item>
 <title>Favicons</title>
 <link>http://www.alanpeart.net/blog/favicons</link>
 <description>&lt;div class=&quot;blog-left&quot;&gt;
&lt;h2 class=&quot;folio-title&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;my blog&lt;/a&gt;_Favicons&lt;/h2&gt;
&lt;div class=&quot;date&quot;&gt;17.09.2009&lt;/div&gt;
&lt;div class=&quot;blog-text&quot;&gt;&lt;p&gt;A favicon is that little icon that appears in the left-hand side of the address bar of your browser when you visit a website, or in your bookmarks menu if you bookmark it, or on the tab if you are using a browser with tabs. Creating a good favicon is an important part of developing a website, since that icon is the most frequently-visible representation of your website. If you design it right, just seeing it will make your site pop into someone&#039;s mind when they open their bookmarks. If you get it wrong, or don&#039;t bother with it at all, you&#039;ve missed an opportunity to make your site stand out just a little bit more.&lt;/p&gt;
&lt;p&gt;The favicon is often a tiny version of a company&#039;s logo, but you can have a bit more fun with it than that. In fact, it&#039;s amazing just what people have been able to do within that 16x16 pixel space. You might not consider yourself much of a graphic artist, but the proliferation of online tools for web developers means that you don&#039;t have to be. A site I&#039;ve been using a lot is &lt;a href=&quot;http://www.favicon.cc/&quot;&gt;Favicon.cc&lt;/a&gt;, an online favicon generator for static or animated icons. You can import from an image file as a starting point, or design a favicon from scratch. If you have a logo image, then generating a favicon is as simple as importing the logo and clicking a button. Take your new favicon.ico file, drop it into the root of your website directory, and hey presto! The boring default &amp;quot;blank&amp;quot; icon that people saw in their address bars when visiting your site is replaced by something a bit more eyecatching.&lt;/p&gt;
&lt;p&gt;As of the time of writing, I&#039;ve been experimenting with creating animated favicons, and I&#039;m using one on this site. It&#039;s a close-up of my eye (imported from a digital photo), with a differently-colored iris in each of the 4 frames of the animation. Slightly cheesy but it made me smile. I&#039;ve got 15 tabs open in my browser and mine is the only one with a moving favicon, so it stands out.&lt;/p&gt;
&lt;p&gt;The main catch is that browsers differ significantly in their implementation of favicons. Internet Explorer doesn&#039;t seem to support animation at all, and has problems with transparency, while other browsers, e.g. Opera and Safari, also don&#039;t display the animated favicon on my site, and therefore may require different code. If you want to explore this in more detail, you could try clicking &lt;a href=&quot;http://mushmallow.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=45&amp;amp;Itemid=60&quot;&gt;here&lt;/a&gt;, or &lt;a href=&quot;http://www.wohill.com/design/437/About-favicons,-animated-favicons-and-favicon-galleries.html&quot;&gt;here&lt;/a&gt;, or maybe &lt;a href=&quot;http://www.rw-designer.com/favicon&quot;&gt;here&lt;/a&gt;. The good news?&amp;nbsp;The animations work in Firefox, and it&#039;s only a matter of time before the other browsers follow suit.&lt;/p&gt;
&lt;p&gt;One last note: I work mainly with &lt;a href=&quot;http://drupal.org&quot;&gt;Drupal&lt;/a&gt;, and it&#039;s shocking how many Drupal websites out there still use the out-of-the-box default Drupal favicon. It just doesn&#039;t look professional in my opinion.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blog-tags&quot;&gt;
&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/14&quot;&gt;browser hell&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/15&quot;&gt;drupal&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/16&quot;&gt;favicons&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/taxonomy/term/17&quot;&gt;graphic design&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-tags --&gt;
&lt;/div&gt;&lt;!-- end blog-left --&gt;
&lt;div class=&quot;blog-right&quot;&gt;
&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td class=&quot;mapicon&quot;&gt;&lt;img alt=&quot;view a larger image&quot; src=&quot;/sites/all/themes/mynameis/images/map-icon.png&quot;&gt;&lt;/td&gt;&lt;td&gt;click image to enlarge_&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;div class=&quot;blog-right-image&quot;&gt;&lt;img  class=&quot;imagefield imagefield-field_blog_image&quot; width=&quot;440&quot; height=&quot;285&quot; alt=&quot;&quot; src=&quot;http://www.alanpeart.net/sites/default/files/econsultant-favicon-gallery_0.jpg?1269963238&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;yellow&quot;&gt;&lt;div class=&quot;blog-teaser&quot;&gt;&lt;div class=&quot;date&quot;&gt;other recent blogs&lt;/div&gt;&lt;div class=&quot;bloglist&quot;&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/63&quot;&gt;Looking for a Drupal themer&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/62&quot;&gt;Drupal 6 Popup Forms&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/55&quot;&gt;Deleting cookies using PHP&lt;/a&gt;_&lt;/div&gt;&lt;div class=&quot;bloglink&quot;&gt;&lt;a href=&quot;/node/53&quot;&gt;table row links in Drupal Views&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;tag&quot;&gt;&lt;a href=&quot;/blog&quot;&gt;see all blog entries&lt;/a&gt;_&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- end blog-right --&gt;</description>
 <category domain="http://www.alanpeart.net/taxonomy/term/14">browser hell</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/15">drupal</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/16">favicons</category>
 <category domain="http://www.alanpeart.net/taxonomy/term/17">graphic design</category>
 <pubDate>Thu, 17 Sep 2009 05:33:44 +0000</pubDate>
 <dc:creator>alan</dc:creator>
 <guid isPermaLink="false">18 at http://www.alanpeart.net</guid>
</item>
</channel>
</rss>
<!-- Page cached by Boost @ 2011-09-23 05:19:03, expires @ 2011-09-24 05:19:03 -->

