For a day or two I have been whining about Sandbox on Andy and Scott’s blogs and in my gettext post. Why? Because I recently “jumped on the Sandbox bandwagon”. Making me boast to friends that I’d switched to a theme that made the site look exactly like as before! While they were staring at me in a way I only could interpret as awe.
The theme really reinvigorated my interest in designing for WordPress since it bring a lot of power to the CSS while giving you harsh constrains on the markup (constrains are good, too many choices result in angst, limitations release creativity). And Sandbox do have the promise of becoming the CSS Zen Garden of WordPress.
So I have decided to collect all my Sandbox “issues” and track theme here in this post.
Table of Contents
Issues
Attribute string escaping Tab character \t visible
I’ve created a patch to escape attribute strings correctly (using " instead of ') in the generated markup tags.
Andy said: “Attribute quoting is valid with single- or double-quotes. They are interchangeable. Your patch actually makes the PHP code harder to read. See the WordPress coding standards.”
I have now been enlightened, not knowing previously about the WordPress coding standards (which is ironic since I’ve written such guides myself).
But there’s actually another issue fixed by the patch: in index.php line 19 there’s a lot of \t\t\t\t in a single quoted string that hence need to be double quoted.
I’ve now produced a patch to fix the issue, index_php_fix.patch, hopefully along the coding guidelines.
function.php r57
The added support for stylesheet-only templates using sandbox in functions.php revision 57 in SVN breaks the support for custom skins. It end up executing the initial if clause not reaching the else if.
Yes indeed, I managed to screw it up somehow. It do work. My wrong. Sorry.
Archive heading not localized
This is not actually a problem with Sandbox but have to do more with WordPress and PHP. If you take a look at the heading on this archive page on my swedish site you will see that the day is suffixed by an english ordinal. In this case “nd” instead of the swedish “:a”. Actually the order is wrong too, it should read “22:a december, 2005” or without ordinal “22 december, 2005”.
So in the case of the archive heading the date should be in another format without ordinal when localized to swedish. However in other cases using a translated ordinal is desirable, like in my Archive Navigation on the same page.
It would be nice if WordPress could provide a solution to these date based localization issues. From what I can tell it only get half the work done (browsing the WP code is actually a little overwhelming even for me).
Hmm… maybe I should have updated that sandbox.pot file earlier anyway. This issue have been fixed, I saw it mentioned in the SVN log but couldn’t figure out why it didn’t show up on my blog. Turns out that maybe I should have localized the dates in my PO file too. Doh!
Still, the problem of untranslated ordinals is withstanding. But as I said. Nothing to do with Sandbox, more of a PHP and WordPress issue.
Annoying characters
Ja wrote: “I need to partially agree with Zeo on the « and » thing (as well as in the title and other nav stuff). This theme has tremendous possibilities for making alternate or user-side Accessibility skins but from what I understand symbols like those are extremely annoying to people using screen-readers. Zeo’s suggestion likely will be decoded as a question mark I believe. Since the theme seems to be transforming into something heavily standards based, Accessibility provisions/features might be a good idea to put on the roadmap.”
I totaly agree with this assesment. Unfortunatly I haven’t got my screen reader up and running yet (I don’t check sites in IE6 on a regular basis but I will with a screen reader… go figure) so I can’t give more details and suggestions as of now.
Enhancements
“Read more” links
Currently there are no “Read more” links on the archive pages. This can be very confusing to the visitors, expecting them to click on the heading to read the whole post. I think it’s obvious that there should be a more-link just like on the front page.
When looking into this I discovered that the more link is in place in the archive.php, author.php, category.php and search.php template code. But it’s done as an argument to the the_excerpt() function that unlike its cousin the_content() do not accept any such arguments.
Category classes
It would be nice to have class names in the generated links to categories. That way they can be styled individually (less likely) and easily manipulated with DOM Scripting (more likely).
In addition to class for the actual category, having a class for any parent category would be really powerful when scripting:
<a href="..." title="View all posts in Widgets" class="category-wordpress category-widgets" rel="category tag">Widgets</a>
Remove “metasep” presentational markup
I have some beefs with the <span class="metasep">|</span> because that is somewhat presentational markup, and presentation should be done with CSS. Or so the WaSP boys and girls tell me…
But as explained by Andy, the introduction of metasep was not an easy decision.
I’ve created a minimal example of my proposed change with explanation. And a second little bit less radical that degrades more gently.
However, the use of generated content and pseudo-selectors are indeed fragile when coming to browser support. But I do think any :before, :after and generated content issues could be fixed with some DOM Scripting for browser that doesn’t suport the pseudo-selectors. I will investigate it, the support and implications.
Of course, this is a HUGE nitpick. But an interesting case study non the less.
Skins as alternative stylesheets
When logged in as admin, all the installed skins should be available as alternative stylesheets so we can select them in the browsers “view/style” menu. Great for developing skins and trying them out live on an admin basis.
Replacing footer content
It would be great of there was a way to customize the content of the footer without actually edit the footer.php template. Björn mentions that such a feature, similar to the one in veryplaintxt, is what he miss in Sandbox.
Conform even more with hAtom
Zeo wrote: “entry-summary class when the_excerpt is used”
2 comments
Hi Anders, and thanks for giving so much attention to our little theme. Some responses:
Attribute quoting is valid with single- or double-quotes. They are interchangeable. Your patch actually makes the PHP code harder to read. See the WordPress coding standards.
I have just re-tested R57 and found it working at intended. In fact it’s live on WordPress.com right now and working fine.
Thanks also for the suggestions. We have several revisions to go before we kick this bird out of the nest and I expect some of your ideas will be represented. Cheers!
Ok, I see about the quoting. But there’s actually another issue fixed by the patch: in
index.phpline 19 there’s a lot of \t\t\t\t in a single quoted string that hence need to be double quoted.That’s what started it. From there I just went beserck and fixed all strings not knowing about the WordPress coding standards. Sorry.
Post a comment