An Occasional Thought...

An infrequent take on WordPress, WooCommerce, and the web.

February 5, 2013
Generally speaking, Drupal does a great job of letting you bulk update content settings across your site. And where core falls short, usually a module called Views Bulk Operations (VBO) jumps in to save the day. But recently I needed a way to bulk update comment settings. I have a side project where I set commenting to be closed for a content type that I ultimately needed to open commenting on. I searched for a while, even giving VBO a run, but it doesn’t provide the ability to update comment settings. Unfortunately, there’s no module, so the next best thing was to update rows in the database manually. There are a couple places where rows need to be updated, so here’s the fastest and easiest way to update comment settings in the database. WARNING: While this is a fairly simple process, if you do not know what you are looking at in the database, this can be a very bad idea!
December 4, 2012
CSS-only ribbons are a popular effect. Sometimes you need a triangle that will make it look as though your element is wrapping in from the left, sometimes the right, and sometimes both. Below are a few snippets to help quickly create these little triangles to create the ribbon effect you desire. We will be using the :before and :after pseudo-elements to achieve this effect, so you will be limited to 2 triangles per element. Pseudo-element browser support for these is as follows: IE8+, Firefox, Chrome, Safari, Opera.
December 3, 2012
Let’s face it, we only type a password correctly about 50% of the time. And when you hit that wrong letter, you erase the entire password and start over. If you’re a fan of XKCD’s method for creating secure passwords, that’s a lot of letters to erase to start over! So why not make the password visible by default? When’s the last time someone was creeping over your shoulder to see your password? What if we create an option to hide the letters still if someone is nearby? Let’s do that with some simple jQuery!
October 8, 2012
Let’s face it, unordered and ordered lists are boring. As web designers, we’ve spent a good bit of time finding ways to make them not look like lists. But sometimes we DO want them to look like a list. Unfortunately, we’re generally stuck with the discs, circles, numbers, and roman numerals available across browsers. If you’re feeling a bit more adventurous, you might even give that list item a background image and some padding for a custom bullet. But with the introduction of retina displays over the last couple years, those just aren’t looking as great any more. What if we used some CSS and the content attribute though to add some vector (it’s just a font) bullets?
July 7, 2012
If you’re collecting simple data from users in Drupal, like from a contact form, chances are you’re using the Webform module. The Webform module is a great way to collect this information, but it doesn’t generate the prettiest forms. Furthermore, support for HTML5 form features, like the placeholder attribute, are currently lacking. To solve this problem, I decided to call on jQuery, which you’re probably already using and comes bundled with Drupal. The Objective What we ultimately want to accomplish is placing the field label in the field as the placeholder attribute text. We will then remove the label from view for the sake of reducing redundancy. Finally, we’ll implement a check to see whether the browser supports the placeholder attribute and only run the function if it does. While our code will easily be changed to suit each project, we’ll look at turning all of this code into a jQuery plugin in a future lesson. See the Demo