Asides

End Internet Explorer’s Stupidity with ie7-js

ie7-js, currently in version 2.0 (beta), is a JavaScript library to make MSIE Windows behave like a standards-compliant browser. This page has the feature lists, and here’s the Google Code page. When this thing eventually works flawlessly it’s going to be huge.

Leave a response

Design

Freebird Theme for Chyrp

Chyrp is a new blogging engine designed to be lightweight yet customizable, and it claims that it “destroys the fine line separating a blog and a tumblelog.” Sounds okay to me. The demo is available here, although some of the functionality has been disabled due to Digg Effect (591 diggs so far, in case someone’s interested).

Anyways, I’m not here to write a review about the engine. Not yet. Instead, after reading about Chryp a little, I decided to learn and find out how the theme system works. While I obviously can’t claim that I have completely mastered the art of Chyrp theme creation, this is what I came up with.

Introducing Freebird, a Chyrp Theme

Free Image Hosting at www.ImageShack.us

This one’s a simple, tumblelog-flavored theme with relatively narrow width and minimal decoration so that your content remains the focus of the site. The screenshot above does not show the admin bar, for which you will need to install Chyrp and use this theme to find out.

Interested? Download Freebird, completely free.

Credits and Stuff

  • The name Freebird is taken from a song by YUI (not to be confused with the Yahoo! UI Library).
  • The background pattern is modified from one pattern made by Squidfingers. Squidfingers’ patterns rock.
  • Icons are from Brand Spanking New’s Mini Icons v2, which by the way is an awesome, free, iconset.
  • Most PHP files inside the theme are copied directly from Chyrp Default, modified here and there to fit.
  • This theme is licensed under GPL.

Conclusion

I plan to create a separate post to discuss more about Chyrp, including how the theme system works, so this part will not be too comprehensive. In short, I find myself grinning a lot while working on Freebird. The theme system is indeed powerful and highly modifiable, and it’s been quite a fun little project to work on. There’s only one page of documentation, but it’s really quite intuitive once you dig into the theme files.

So, this is where I leave you to play around with the new theme. Have fun!

4 Responses

WordPress

WordPress 2.5, Backend Redesign, and Happy Cog

So the news is out that the next version of WordPress, 2.4, is not going to happen. Instead, we will immediately get 2.5 by March 2008. Following the links, I got to read that one of the most anticipated update for the next version is that the backend will be redesigned.

Now, that is big. I don’t think it’s an understatement to say that there are hundreds of thousands of people utilizing the WordPress admin everyday. Scratch that. Matt said that the Presentation page in the wordpress.com backend got 2.4 million pageviews by October 2007. On just the Presentation page. Without counting the self-hosted installation.

In other words, there is a huge number of people who have familiarized themselves with the current backend design. If you’re going to redesign it, this is a big task.

And then I found out at wp-hacker mailing list archives that Happy Cog is doing the redesign.

Happy freakin’ Cog. Wow.

Think of this, an open-source project hiring the web agency headed by the King of Web Standards himself to redesign the backend design. If you haven’t heard of them, Happy Cog is to web design the way Liquid Tension Experiment to progressive rock scene. In a word, a supergroup.

More evidence about this fact could be found at the WordCamp site and also hinted at Liz Danzico’s blog. Liz is the information architect, usability analyst and editor at Happy Cog.

Now, this is a wonderful move by WordPress. For a task this big, they have chosen to do the right thing: get the professional to tackle it. I’m not sure if the redesigned admin demo here is the one made by Happy Cog or not, but since Matt said that it’s probably around 10%-20% of the real thing, it’s best to save the comments for now.

All in all, it’s a great news. I’m so going to learn and tinker and tear it apart once it shipped. Now, for the painful task of waiting until March…

PS: If you want to dig around more on the wp-hackers archives about Happy Cog’s involvement, this might be a good start (it’s a Google search because the archives page itself does not have a search functionality).

2 Responses

Design, WordPress

Decluttering WordPress Theme’s Sidebar Widget Code

The usual code for a widget-enabled sidebar goes like this:

<div id="sidebar">
  <ul>
    <li id="pages" class="widget widget_pages">
      <h2 class="widgettitle">Pages</h2>
      <ul>
      <li class="page_item page-item-2"><a href="http://url/?page_id=2" title="About">About</a></li>
		  <li class="page_item page-item-2"><a href="http://url/?page_id=2" title="About">Contact</a></li>
      </ul>
    </li>

    <li id="categories-1" class="widget widget_categories">
      <h2 class="widgettitle">Categories</h2>
      <ul>
      <li class="cat-item cat-item-3"><a href="http://url/?cat=3" title="View all posts filed under Asides">Asides</a></li>
      <li class="cat-item cat-item-1"><a href="http://url/?cat=1" title="View all posts filed under Uncategorized">Uncategorized</a></li>
      </ul>
    </li>
  </ul>
</div>

This is where I begin to wonder. Why do widgets go into an unordered list? Semantically, it’s possible to argue that the sidebar is actually a list of widgets, therefore the usage of the <ul> tag. But with that same logic, the content area of a blog is basically just a list of posts. Yet I never found any theme placing each post inside an <li> tag. Have you?

This is what Automattic has to say on this, emphasis mine:

Notice that the entire sidebar is an unordered list and the titles are in <h2> tags. Not every theme is built this way and it’s not necessary to do so, but it’s currently the most common sidebar markup in the themes we surveyed so we adopted it. The element with id=”links” is the equivalent of one basic widget.

So, I assume that this practice date back before WP Widgets is created, and is simply picked for compatibility reasons (so that it’s easy to convert already-made themes to be widget-ready). But that does not mean it is still necessary for new themes, I believe.

If you take a look at some of the more well-known web designers’ code, you’ll see that they don’t do this on their sidebar. While none of these examples actually used WordPress widget on their site, but does that matter? Widgets or plain old hardcoded PHP, we’re simply talking about items (or sections, contents) on the sidebar, right?

The last thing that also bothered me is that the usual code above looked so cluttered. Tag soup, anyone? Nested <ul>’s and everything. They’re actually quite difficult to follow, and I don’t see a reason why something simpler can’t be achieved yet still be semantically okay. Something like this, for instance:

<div id="sidebar">
  <div id="pages" class="widget widget_pages">
    <h2 class="widgettitle">Pages</h2>
    <ul>
      <li class="page_item page-item-2"><a href="http://url/?page_id=2" title="About">About</a></li>
    </ul>
  </div>

  <div id="categories-1" class="widget widget_categories">
    <h2 class="widgettitle">Categories</h2>
    <ul>
      <li class="cat-item cat-item-3"><a href="http://url/?cat=3" title="View all posts filed under Asides">Asides</a></li>
      <li class="cat-item cat-item-1"><a href="http://url/?cat=1" title="View all posts filed under Uncategorized">Uncategorized</a></li>
    </ul>
  </div>
</div>

Mm. Tasty.

And So We Bump into Troubles…

By default, the value for the function register_sidebar (consult Widgets API docs page for more info) are these:

$p = array(
  'before_widget' => '<li id="%1$s" class="widget %2$s">',
  'after_widget' => "</li>/n",
  'before_title' => '<h2 class="widgettitle">',
  'after_title' => "</h2>/n"
);

register_sidebars(1, $p);

In other words, the built-in Widgets code is to put each of them inside an <li>. To fix this, we do it this way:

$p = array(
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
  'after_widget' => "</div>/n",
  'before_title' => '<h2 class="widgettitle">',
  'after_title' => "</h2>/n"
);

register_sidebars(1, $p);

And to set-up the Widgets area inside sidebar.php, simply use the code:

<div id="sidebar">
  <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
  // static code here
  <?php endif; ?>
</div>

And that’s it. Simple changes, much lovely code. Thoughts?

4 Responses

Page 2 of 212

Hello!

My name is Hafiz Rahman. I do standards-based web design and WordPress works. I'm open for new projects, and here's where you can contact me.