Updates and thoughts from the Digital Platforms and Developments team in Marketing at the University of York.
Friday, 6 August 2010
Zen coding for rapid HTML authoring
Instead of writing HTML syntax, Zen Coding lets you write CSS selector-style abbreviations and hit a button to expand them to HTML. It’s lightening quick and lets you write HTML snippets in seconds. Simple additions to the CSS syntax allow for output of multiple tags (eg. li*2 becomes <li></li><li></li>
) and automatic numbering (eg. link-1, link-2). It’ll do even more clever stuff than that too, but I’m still a novice!
A really quick example:
blockquote#boxout>h2+p+ul>li*3>a[href="/link/"]
expands instantly to
<blockquote id="boxout">
<h2></h2>
<p></p>
<ul>
<li><a href="/link/"></a></li>
<li><a href="/link/"></a></li>
<li><a href="/link/"></a></li>
</ul>
</blockquote>
Filling the empty code with content is easy too because there’s a handy ‘next sensible spot’ keyboard shortcut to skip from the H2 to the P to the LI to the HREF etc.
The one gap for me is that I have to use a text editor to use the Zen Coding expansions. Most of my coding is done in Firebug or within our CMS so I can’t use the expansions directly where the code needs to be. I’ve always got a text editor open so it’s not a big deal, but a Firefox/Chrome extension or integration with a generic text expansion utility (as Paul blogged about previously) would be even more brilliant.
There’s a full tutorial on Smashing Magazine, including the rapid-fire demo video embedded below which shows just how fast it can be and what it’s capable of.
Thursday, 8 July 2010
Quick CSS tip - alphabetise your properties
.myclass {
position:absolute;
top:0;
left:0;
width:42%;
margin:0 0 0 8px;
padding:8px 10px 10px 10px;
border:1px solid #e6e6e6;
background:#f5f5f5;
visibility:hidden;
font-size:85%;
}
Properties in alphabetical order
.myclass {
background:#f5f5f5;
border:1px solid #e6e6e6;
font-size:85%;
left:0;
margin:0 0 0 8px;
padding:8px 10px 10px 10px;
position:absolute;
top:0;
visibility:hidden;
width:42%;
}
Image by Jan Tik
Friday, 27 November 2009
Blog publishing from Word
I've just created a new document in MS Word 2007 for the first time since I upgraded and there were two options presented: blank document or blog post. I'm not supposed to be writing a blog post right now, but the temptation is too good to resist.
Early signs are good, because Blogger is listed as a blog I can write for. The next step doesn't fill me with confidence because Word announces that when it contacts the blog provider my username and password may be visible to others. But I'm reckless, so carried on regardless.
I'm now writing my blog post in what looks like Word's normal editing screen, just with a few things removed. It's actually quite good.
Wednesday, 30 September 2009
How to write code (or anything else) much quicker with text substitution
There are lots of text substitution packages available, but they all work in a common way - you set up shortcuts (small pieces of text), which when triggered are substituted with longer pieces of text.
Here's some shortcuts in action that I've set up for writing HTML:
Not just for writing code
The application of text substitution isn't limited to writing code. It comes in handy any time you find yourself writing the same text from day to day. For example, I find myself writing the phrase "writing for the web" a lot, so I've set up a "wftw" shortcut that does that for me. You can even set shortcuts for whole canned email responses to common questions and save yourself a whole load of time.
More information
For a great overview of the topic and the tools available for different operating systems, see the lifehacker article Save time with text substitution
Wednesday, 2 September 2009
How to quickly search the University Directory from the Firefox address bar
- Go to the University homepage
- Click on Contacting People
- Click on Directory
- Type in the name of the person you're looking for
- Click Search
2. Right click in the Surname field, and select Add a Keyword for this Search...

3. In the Add Bookmark dialog box that appears, give the bookmark a name and a short keyword. I've used "d" (for "directory").


