PeppermintOS: Minty Fresh!

A while ago, I decided it was time to get a laptop.  I’ve been meeting with local clients more and having a laptop handy would make a lot of that stuff go more smoothly.  I’m also on the web committee for my kids’ school, and have had to borrow someone else’s laptop to do WordPress demos and show them things.

So, I started looking around at netbooks and my first thought was to (of course) install Ubuntu.  But after initially throwing a distribution of Linux onto a thumb drive and finding out that the thumb drive installation of Ubuntu is 2GB and requires you to format the drive (meaning I couldn’t use it for other things as well), I instead used Puppy Linux, which worked well for that.  Then I became aware of PeppermintOS via someone on Empire Avenue.  I took a look at the screenshots and read the descriptions and the mission statement and thought it would be perfect for the netbook I didn’t have yet.

Fast forward to now.  I don’t have a netbook, but I do have a hand-me-down Dell Latitude from my father-in-law who was looking to get a new laptop as well.  I helped him pick it out (a sweet Acer Aspire with 6GB of RAM and a 640GB hard drive — most of which will go unused since it’s been set up to do most of his work on the cloud) and I set it up and migrated his old Outlook file over to keep his email archives while he migrates to using Google Apps for email and docs.  (The conversion process went remarkably smoothly with the help of Dropbox for backing up his entire My Documents folder and syncing it up on the new machine.)

Once I said goodbye to his brand new laptop, I said hello to the old one and immediately pulled out an old Ubuntu 10.04 disc I had lying around.  I started the install — wiping the hard drive clean of Windows XP — and in an hour or so was looking at an Ubuntu desktop with one problem — though the sound worked beautifully, I wasn’t connected to the internet.  I quickly realized/remembered that most Linux distros don’t really like the wifi adapter in Dells and require ndiswrapper or some other hack to get them to work.  I tried to dig out the documentation and remember how I dealt with this last time, but gave up quickly — having no internet access (and being too lazy to dig out my extra ethernet cable) as well as running an old version of Ubuntu just didn’t seem worth the trouble to get it running right.  I decided to download the current version and use that instead.

Of course, part of the problem with Ubuntu is that it’s bundled with Firefox, and I rarely — if ever — use Firefox these days.  I wondered if there was a fork of Ubuntu that came with Chromium instead and started looking around when I remembered Peppermint, with its two flavors — one built with Firefox and Prism, and the other built with Chromium and Ice (a variant of Chrome’s application shortcuts).  I downloaded the light (478MB for Peppermint Two vs the 699MB crammed onto the Ubuntu installation disc) .iso file and burned it and started a Peppermint install.  The process was more or less identical to the Ubuntu install I just finished.

Like Ubuntu, I had no wifi.  This I expected.  I had the recommended drivers I found from somewhere and discovered ndiswrapper already installed in Peppermint (vs. not being installed in Ubuntu 10.04) — in fact, I later found a gui for ndiswrapper, which I thought was pretty cool, even if I didn’t use it.  However, after using ndiswrapper from the commandline to get my driver installed, the wifi card was still not detected.  I did some Googling and found that Peppermint has a utility to scan the hardware and look for third-party drivers.  That required an internet connection, so I got it hooked up, ran the scan, and found some Broadcomm drivers.  I clicked the little activate button and, after a restart, it worked!  Wow, seriously?  That was easy.

That wasn’t the only thing that was easy, though.  I recalled from when I was dual-booting Ubuntu and Windows 7 on my desktop that creating application shotcuts in Chromium on Linux was a losing proposition.  It was a pain to get the shortcut set up and actually functional and I ended up giving up on the whole thing.  Not so with Ice.  All you need to do is tell Ice what the url to the webapp you’re trying to create a shortcut for is and chose an icon you want to use and you’re done.  More than that, the “create application shortcut” (my first impulse being a Chrome user) option actually works!  Maybe this is just a result of the updates to Chromium since last I used it, but I kind of suspect not (if they cared that much about that option on Linux, it wouldn’t be a menu item — at least, it shouldn’t be).  This makes me think it has to do with the Ice app that was specifically designed for PeppermintOS and Chromium.

Peppermint is designed for netbooks — which is good, because that’s how I wanted to use my laptop.  It’s built to be a work laptop that I can take with me on the road, so most of the stuff I want will be web-based.  So Peppermint comes with integrated Ice (or Prism, depending on your flavor of Peppermint) shortcuts to web-based applications like Gmail, YouTube, Pixlr (rather than coming with GIMP installed), Seesmic Web (which I replaced with HootSuite), and Google Apps.  It also has a shortcut to Dropbox which — upon a first run — will download and install the Linux Dropbox client to get you synced up with your Dropbox files.  Possibly my favorite part is that there are no bundled obnoxious sounds for everything.  As much as I appreciate the quasi-tribal boot-up sound of Ubuntu, in almost every case for every install of Ubuntu I’ve ever done, the volume is set to deafening, and that sound quickly loses it’s novelty when the volume is cranked up to eleven.  Peppermint — focusing on being a stripped-down, lightweight netbook-style distribution — doesn’t come with any of those sounds.  To the extent that I started wondering if I even had the sound set up at all and, after deciding I didn’t really care if the laptop had sound or not, tried popping a CD in there to finally test and was surprised when it started playing.

The only possible criticism I have is with the built-in music player Guayadeque, which, while it has loads of tools for streaming and playing local media files, has a clunky interface for playing CDs and no real way (that I can see) to drag and drop tracks from the file manager to the music player or create a playlist without clicking on each track from the CD.  That’s not a huge issue for me, particularly since there’s so many web-based options that are already built into the OS like Last.fm and Pandora could be added easily with an Ice shortcut.

Peppermint is my new favorite Linux distribution.  It beats Ubuntu by a longshot with extra credit for being small, not bundling a bunch of crap I don’t want (particularly Rhythmbox, a bloated music player that I’ve never liked — only tolerated because I had to — and generally ignored in favor of some flavor of XMMS), and making the setup and customization processes a snap.  Even though I had to go online to get a driver for the wifi card, that itself was so easy an idiot could figure it out, and once it was installed, I haven’t needed to plug in my ethernet cable (as opposed to Puppy which often dropped a local wifi connection and forced me to reconfigure the thing every time).  Peppermint compliments my style of computing, which is to give me the bare essentials and let me put on my own damn apps, thank you, rather than assuming some software bundle that would be most useful for the average user the way most Linux distributions (and Ubuntu, in particular) do.  I’d also like to give props to the Software Manager, which pulls from a variety of repositories with an easy-to-use-and-navigate interface that makes installing new packages super-easy.

If you have even a casual interest in either Linux or just dumping Windows and trying another operating system, I highly recommend checking out and downloading yourself a copy of Peppermint.

Why dual-boot Linux when you can run it from a USB flash drive?

I’ve been a sideline fan of Linux for a long time.  My very first experience with it was buying one of those 800 page, dictionary-sized technical manuals for Linux which came with Red HatSlackware and Caldera.  I effectively destroyed my Windows 95 box trying to get Red Hat installed and failing.

After that, I was much more cautious, but I’ve always had an active interest in Linux.  For about a year I trolled Distrowatch to keep up-to-date about distribution updates and what was hot.  While I was working at Albertsons, I randomly decided to install 5 of the most popular Linux distributions into a VirtualPC environment to test them out and see which one I liked best (I ultimately decided I still liked Ubuntu best, with Fedora being a fairly close second – if it wasn’t for the fact that I dislike KDE).  I’ve tested more Linux distributions than I can count on my fingers and for about a year I ran Ubuntu as my primary operating system at home, only booting to Windows for games.  I gave that up when I left my job at Albertsons to do web design full time.  As much as I like Linux, running virtualized versions of Adobe applications was just going to unnecessarily eat up resources, and I’m still not ready to switch to GIMP (though I could probably ditch Dreamweaver for just about anything else as long as it runs well).  For a few months I had an Ubuntu partition on my main system, but I never used it, so I got rid of it.

Linux on a stick

For the winter holiday, I got a USB thumbdrive.  The main use I had in mind for this was pretty much the same as my old zip drive when I was in college – to store large files – mostly graphics — that I could transport and use on other systems.  We don’t have a printer because for the amount that ink cartridges cost vs. the amount we actually print anything on paper, it’s just not worth it, so I end up going to FedEx/Kinkos to print stuff, using their online form to upload files from home.  This is fine and dandy, but when I have something that I know would take them 3 minutes to run if they just got off their ass to do it, it’s annoying to wait a half hour or longer for them to call and say it’s done.  Enter the thumb drive: I can save whatever document I need to print on that, take it to the FedEx/Kinkos office, and print it myself.  When I noticed they had USB ports for such purposes, it was instantly on my list.

Realistically, I only need maybe 500 MB for anything I might possibly need to print, if that.  The USB thumb drive (which now lives on my keychain) is 2GB – so what to do with the remaining 1.5GB?

My first task was to export my data from LastPass to the thumbdrive.  I’ve been using LastPass and updating all my passwords to more secure ones (14 characters, alphanumeric with symbols, randomly generated), so this way I could have a backup of my passwords that was always on me and encrypted.  That’s 138KB.

Then I saw a blog post on LastPass’ blog that talked about how to install a portable browser onto a USB flash drive and install their plugin on said portable browser – that way you can take your entire password vault to any computer you want and run the browser from your USB drive.  I went straight out and downloaded Google Chrome Portable, installed the LastPass extension (and, actually, ran Chrome’s sync to grab all my other extensions and bookmarks).  Now I have an entire browser with all my ridiculously encrypted passwords that can run straight from my USB drive on any (Windows) computer.  That was another 150MB or so.

I started toying with the idea of running Linux from a USB drive and started looking into how it was done.  Most of the manuals and blogs I found on the subject were a couple years old, so that didn’t help when many (if not most) Linux distributions release updates at least once a year if not more.  I did, however, learn that running the portable version of Ubuntu took between 1-2GB and would wipe out any existing data on your drive – not ideal, so I started looking at alternatives.

I chose Puppy Linux because it’s designed to be small and portable (100MB!).  It also doesn’t seem like it gets updates every 6 months which, in this case, is a good thing (since I won’t be updating an operating system that lives on a USB drive).  The documentation on the Puppy site is a bit of a nightmare, though, so I waited.  Then I stumbled on Pendrive Linux.  Pendrive Linux has a Universal USB installer that will install any from an exhaustive list of distributions (and any distro you want that’s not on the list) directly to your USB drive without you needing to do much of anything (other than download the actual ISO).  The link built into the installer for Puppy Linux Lupu 5.2 was broken, but I was able to navigate through the FTP server to find where it actually lived.  After downloading the ISO, the actual installation took maybe 5 minutes.

From what I’d already read, I knew that I’d need to go into the Boot Menu during startup to select the USB drive as a boot device.  About 45 seconds later, after being greeted by a friendly Puppy logo, I was at the desktop.  I was surprised by how quick the everything moved – I was used to LiveCDs where you clicked on something and have to wait a minute for the system to respond.  Everything behaved as if I was running an operating system directly off my hard drive.  The other thing that I found pretty cool about Puppy is that you can save your settings onto your flash drive, which means that when I clicked on Browse and was prompted to install a browser (Chromium, onto which I again installed the LastPass extension and then synced my bookmarks and preferences), it would be able to save everything I downloaded into its save file.  LastPass bitched at me for using the autologin option, so when I was prompted to save my Puppy preferences when I went to shut down, I encrypted the save file, so you’d need to enter a password to get to the Puppy desktop.  You can choose the size of your save file – I chose 512MB, the default – in sizes which range from very small (I didn’t pay attention, but I think it was as low as 64 MB or less) to 2GB.  All told, with Chromium installed and my 512MB save file, the entire operating system takes up just 640MB, leaving me with more than a gigabyte to do whatever I need to.

Now, not only can I run a personalized browser on any Windows computer from my USB drive, I can run an entire freaking operating system from my USB drive, presumably (though this is, as yet, untested) on any computer anywhere.  And it fits in my pocket.  If I wanted, I could install a LAMP onto Puppy and tell people I had a webserver in my pocket.  But that’s a little insane, I think.  The whole process was surprisingly, ridiculously easy and I never once needed to boot from a LiveCD or otherwise boot into Linux to run the install except to actually test the fully-installed OS.

The idea that I can carry around a ready-to-go operating system in my pocket that I can use on any computer is pretty awesome (as well as the fact that you can get a drive to run said operating system for less than $20) and I’m sure has implications I haven’t even fathomed yet.

WordCamp Utah 2010 — a belated recap

One of the things I heard at WordCamp Utah was that it’s not what you learn at WordCamp as much as the research and stuff you learn once you get home and start trying all this stuff out.  In that sense, I don’t think I actually left WordCamp at approximately 5:30 Saturday evening a few weeks ago.  Or, at least, WordCamp hasn’t left me.

This being my first WordCamp, I had to come to a few realizations that weren’t altogether surprising, but they were necessary.  One important one was that there’s two types of information you get from WordCamp: there’s the stuff you learn in the sessions you go to, and there’s everything else, including fragments of conversations, bits of code peeked at over someone’s shoulder, and rubbing elbows with someone who just happens to have an awesome event registration plugin.  Learning isn’t confined to a classroom, and WordCamp isn’t just about the seminars.  In Matt‘s town hall session, he said

If I could design the perfect introduction to WordPress…it would be a WordCamp.

I don’t think he was talking just about what happened inside the lecture halls.

The first half of my day was spent at the Geek Genius Bar.  Those of us who had volunteered for the Genius Bar were asked to come a few minutes before registration officially opened.  I made it — barely — only to find that I had no idea where to go.  I found my way to the Skaggs Biology Building easily enough (Google Maps being my friend), but once I got my badge, t-shirt, and obligatory swag (some of which was identical to the swag I had just received with my WordPress t-shirt and officially-signed certificate of being one of the three most important people in WordPress about a week before), there wasn’t any place already established for us geniuses to meet.  In fact, after passing the big guy with the purple hair and the 9Seeds shirt, I asked a couple of attendees if they were “geniuses” only to be greeted by resounding “uh, no!”‘s, to which I had to explain that I was (though I didn’t feel like it at the time), and as such, had no idea what I was supposed to be doing or where I was supposed to be.  Only later did I learn that said purple haired geek was Todd Huish from 9Seeds — who would be spending the bulk of the day manning the Genius Bar whether anyone else was joining him or not — as he started moving some chairs and a table that would serve as the Genius Bar.

There was no signage for anything — one of the things overlooked during planning that Joseph Scott — who organized the shindig — hadn’t gotten to — so I took it upon myself to print out some of my own from my analog tablet: a small notebook.  I spent much of that first half of the day hanging out with Todd and Seth Shoultes (who makes Event Espresso).  And, of course, one of the first questions we fielded made us all doubt our collective genius-hood, it being a complex programming challenge that didn’t really have anything in particular to do with WordPress other than that the person involved (who was a spokesman for “a friend”) wanted to use WordPress for this site.  That was, thankfully, the most difficult and least WordPress-related question we had to take (at least while I was sitting there).  Which leads me to another revelation I had: I know an awful lot about WordPress Mu/Multisite.  During the course of my tenure at the Genius Bar, I also met Josh Strebel of Page.ly.  I checked Page.ly out when @WordCampUtah retweeted that they’d be there, and they’re doing something really cool.  WordPress-specific, managed hosting, so you don’t need to worry about how your site is running, you just need to have it.

Before lunch, Matt Mullenweg did his thing, and for WordCamp Utah, his thing was a town hall forum wherin he answered questions that led to topics ranging from the GPL to Kanye West’s Twitter account to the machinations of GooVerizonigle.  I was happy that it wasn’t just his keynote at the SF WordCamp in May (which can be seen on WordPress.tv and partially inspired me to attend WordCamp in the first place), but I was a little disappointed that it wasn’t something more substantial.  I love Matt’s talks, I’ve listened to a few and follow his blog.  Of course, that means I have a pretty good idea of what he’s going to say about any particular topic, so I ultimately decided that it was better this way.

Lunch.  So, also on the Utah WordCamp site, Joseph announced that BlueHost was footing the bill for lunch and that it was going to be from Sugarhouse Barbecue.  Great, says the vegetarian, looks like I need to bring my own lunch.  While I wasn’t overly annoyed at the choice of entrees — I’ve been veggie long enough not to assume that people will take it into consideration and find alternative sources of nutrition, or at least things resembling nutrition — I was annoyed when it got closer to lunch hour and I had more than one “oh come on, you know you’re just here for the free barbecue” comment tossed at me.  Um.  Actually.  No.  And while I wasn’t overly surprised that there wasn’t, at least, a fish option (heaven forbid a veggie-burger), I couldn’t help but be the least bit disappointed with my lunch of potato salad and cole slaw.  At least it was good potato salad.  And a cookie.  A really big cookie.  And, despite the fact that I’d sworn off soda earlier in the week, someone managed to dig out the last Coke from the cooler, so all in all, it could have been worse.  And anyway, the best part of lunch wasn’t the food.

I hung out with Todd, who’s an extremely cool guy, and we talked about Thai food and pizza and probably other stuff, too, although the food stuff seems to stand out most in my memory for some reason (possibly subconsciously wishing it was that food on my styrofoam plate, rather than what I had).  Later, while waiting for the Will it Blend? session, I started eavesdropping, then deliberately cut into a discussion and show-and-tell of the new WordPress feature to 3.0, custom post types.  Custom post types sounded like a cool idea, but I had no idea how to actually use it.  I got to see how John Hawkins (also of 9Seeds) was using it for the WordCamp Las Vegas site, and it’s astoundingly cool.  Not just cool, but useful.  The first thing that comes to mind is the ability to design an e-commerce site strictly by using custom post types — no plugins, special themes, or extra software required.  Boo yah.  Throughout the day (and before even going to WordCamp Utah), I heard various mentions of “child themes” which was a concept I sort of filed away for later.  If you’ve seen my tweets on @ArcanePalette recently, you’ll know that it’s now my new most favoritest thing about the new WordPress, and we’re planning on doing a lot in the child theme department in the coming months.

The answer to the question Will it Blend? was, well, no, actually.  WordPress defeated the blender.  Sort of.  “WordPress” was being represented by a USB thumb drive of WP code and a coffee mug with the WordPress logo.  The audience insisted that the mug go right-side-up and that was the undoing of the blending, since it got stuck and was unable to get caught by the blade.  Tom Dickson eventually made an executive veto and flipped the mug, which was duly turned into porcelain dust.  But before all that we got to hear about the no-budget viral marketing campaign of Will it Blend? Basically, BlendTec was this company (K-Tec, originally) that had awesome products, and assumed if you had an awesome product, so come the sales.  Obviously no one in their company was a marketing guy.  So they started this Will it Blend? campaign of throwing stuff into their blender and a few million views later, online sales (for a really freaking expensive blender, mind you) are up 700%.  It was kind of fascinating, and I probably wouldn’t have gone if it weren’t for the fact that it was pretty much assumed that everyone was going to be in the room.

Immediately following that was John Hawkins’ plugin development session (which you can actually see here, although it’s from Portland).  Another one I wasn’t planning on going to, but since I had just watched him blow my mind with custom post types, I figured I’d drop in.  I haven’t ventured into plugin development.  I’m a visual guy, not a code guy (although increasingly I’m getting more and more dirty with code).  So building plugins wasn’t something I thought I’d really have any reason to do.  That was extinguished when he opened with how he got into plugin development.  See, he likes to change his theme all the freaking time, and the annoying thing about that is that if you have a lot of custom code, that means having redo all that stuff all over again.  (At this point my ears perk up — this sounds very familiar.)  You can get around that by building plugins that handle all that extra functionality.  You know, the rest of the session, it almost didn’t matter (I mean, sure, I got to see how easy it is, and all you need is the header information and there are a couple really cool development environments that aren’t Dreamweaver that you can use — sorry, I’m still hooked on Dreamweaver) because that first 5 minutes was really all I needed.  That and a couple of links that I duly took home and looked up, building 5 separate plugins to handle the custom code and added stuff that I throw into this site.  (Note: expect this space to change its appearance on a  more regular basis — like every time we release a new Museum Theme.)

Following that was the BuddyPress session, which I was planning on attending.  However, I got less out of this than I had hoped because it was really more about why you should use BuddyPress than stuff you could do within it (although I did learn about a BuddyPress plugin that I’m planning on adding to Museum Themes to automatically sign people who buy a theme up for the Support Forum, rather than making them have to join the group first).  The last sessions of the day were one on theme development, and Josh Strebel’s presentation on Collaboration over Competition.  I stuck around for Josh’s presentation partially out of laziness (it was in the same room, after all), partially because the Event Espresso guys were there, partially because I already know an awful lot about theme development.  Now, as John pointed out earlier in the day, you always learn something, and you might think a geeky developer-type like him would be beyond picking up new information in a session about ‘the loop’, but if you thought that  you’d be wrong.  Still, I stuck around because I was kind of sort of trying to get on Josh’s good side (I not-so-secretly wanted to see if we could get Museum Themes offered alongside StudioPressWooThemes and Press75).

I have a few things to say about his presentation.  Now the main point of the presentation I get, and I’m right there.  Just because we’re competing in the same market doesn’t mean we have to be head-to-head — it doesn’t mean we can’t still work together on the same projects or help each other out.  He uses the example of the 10,000+ plugins in the official WordPress plugin repository.  More than 10,000 plugins!  And while Matt uses this as evidence of a great, thriving community, Josh points out that he found 5 separate plugins 111 plugins all for the new Twitter tweet button.  Couldn’t those 5 111(!!) people work together and build 1 really cool tweet button plugin, rather than 5 111(!!) kind of crappy (and a few possibly mediocre) ones?  That’s the gyst, and here’s my beef: in a perfect world, where all things are equal, and all coders, designers and hackers are equal, sure, we can spread the load, we can all work together to build one really amazing platform for…something.  But competition breeds innovation.  Competition breeds originality.  So there’s 5 tweet buttons or 15 premium theme developers, sure we could work together and have 1 tweet button, 1 premium theme, but in that game, the one with the loudest voice rules.  It eliminates the possibility for something really interesting and innovative.  In fact, it’s kind of the polar opposite of our mission with Museum Themes.  See, the thing about the premium WordPress theme market is they’re all trying to be the best thing for you.  Every single one of you (or, alternately, all twelve of you if we’re talking about the people who actually read this blog).  We don’t care what everybody wants, in fact, we reject what everybody wants.  We design based on what we want, with the assumption that there’s gotta be people out there with similar tastes, similar values, and similar styles.  In short, we design for individuals rather than masses.  So there, I said it.  And you know what?  I am collaborating.  Right now.  I added a fix to some bugs I found in Event Espresso Lite (aka Advanced Event Registration), and I’m working with the Event Espresso peeps to build some event registration-based themes along the lines of a real ticketing site (see: 24tix.com, ArtTix, SmithsTix.com, find your local equivalents).

And that brings us to the final point of WordCamp — possibly the most important one.  It’s not about any of the shit that happens at WordCamp.  It’s about people.  It’s about ideas.  It’s about what you do when you leave WordCamp.  (I think I said that one already.)  And it’s weird and also pretty cool to have people on Twitter that I follow now that I actually know in real life.  It’s a lot cooler than, say, being the guy who told Matt where the bathroom was (yeah, that was me, too).

Hack to In-Place “Downgrade” from Windows 7 Ultimate or Professional to Less Premium Editions

stumbled across this “duh” of a hack to allow up/downgrading (depending on your perspective) of a more premium version of windows 7 to a less premium version.  why would you do this?

if you were running a beta or rc version of windows 7 you can “upgrade” to a retail edition without wiping the system.

meaning those win 7 home upgrade dvds i pre-ordered for $50 when i decided to go legit with windows 7 in the summer won’t a) go to waste or b) require me to wipe both systems, install XP or Vista, then upgrade to windows 7.

Hack to In-Place “Downgrade” from Windows 7 Ultimate or Professional to Less Premium Editions » My Digital Life.

this is especially handy considering i’ve effectively failed (several times) to upgrade from a fresh windows xp install to windows 7.  (could that have something to do with the fact that the xp install was cracked or not activated before the upgrade?  it’s possible.  why did i do an xp-to-win7 install instead of a vista-to-win7 install?  i figured xp would be a faster install process.  which it would have been…if it worked.)

the “duh” part of this hack is that basically you’re finding a registry value that says “this os is Ultimate edition” and dumbing it down to say “this os is HomeBasic edition” or whatever.  given that the alternative i was beginning to consider was to find a crack to extend the lifecycle of the evaluation version indefinitely and use the retail versions if i actually did for real need to wipe the systems at some point in the future, i think that — despite this not being microsoft’s favorite idea in the world — it’s at least better than other options.

Easy javascript to spice up your search box and save space

class=”aligncenter” Hey again.  Been super busy around here lately, but something I found made me want to share.  This is a quick and easy trick that looks awesome and will save valuable space on your website.  Ever seen those boxes where you enter your email address or a search and it says “enter search/name/whatever here” and that text goes away as soon as you click there?  If you’re not using a Revolution/StudioPress theme, it’s probably not built into your site for you.  Here’s how to add that functionality.  (Note: for anyone familiar with javascript stuff, you don’t need to worry — there’s no external files attached to this one, just a quick code snippet and then you’re on your way.)

First, a little setting: this will work in any <input> box — that is a box that you type into.  So a search box, email submission form, whatever.  Also, you will need to edit code.  I am going to use WordPress as an example, and I am going to use the search box, but this can be applied to any input box once you know the basics.  Ready?  Here we go:

Find the default search form (searchform.php).  If your theme doesn’t have one, you can make one by copying searchform.php from the WordPress Default theme (or, really, any WP theme).  The searchform.php just handles the actual search box itself, so you’re not likely to mess anything up.  Once you have it, open searchform.php in your favorite text editor, HTML editor, or the Theme Editor in the WordPress admin.  You’ll probably see something like this:

<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<label class="hidden" for="s"><?php _e('Search for:'); ?></label>
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s"  />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>

That’s your search form.  To make text display in the input box (which is where you type stuff), replace this line:

<input type="text" value="<?php the_search_query(); ?>" name="s" id="s"  />

with this:

<input type="text" value="Search this website..." name="s" id="s" onfocus="if (this.value == 'Search this website...')
{this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" />

If you want, you can change the “Search this website…” to be whatever text you want, but make sure you change it everywhere.  What it’s doing is a simple if statement that is triggered when you click inside the box (onfocus) or somewhere else (onblur): if the text in the box says “Search this website…” change the text to ” ” (i.e. nothing).  if the text in the box is ” ” (i.e. nothing), change it to “Search this website…”  Easy.  And now you can get rid of this part entirely:

<label for="s"><?php _e('Search for:'); ?></label>

thereby saving space.  Handy, and also visually interesting.  Also, as I said, no external javascript files to upload, and can be applied just about anywhere, once you get the hang of it.

If you liked this post, feel free to share with one of the links below, or follow our RSS feed.  Also, we’re on Twitter, and you can follow us there.  Thanks!