Category Archives: Drupal Theming

How To Override a Contributed Module’s Function

I wanted to change the message of the add-to-cart confirmation popup message on the gench site.

I’m using the Commerce Kickstart distribution of Drupal. Utilizing the Theme Devel module, I can see that a contributed module named commerce_add_to_cart_confirmation is delivering the message text I want to change.

Thanks to my newly minted DrupalizeMe knowledge, I know I can override a contributed module’s function(s) from the theme layer. So I find the function responsible for the message in profiles/commerce_kickstart/modules/contrib/commerce_add_to_cart_confirmation/commerce_add_to_cart_confirmation.rules.inc. I copy & paste the function into my theme’s template.php file. I preface the name of the pasted function with the name of my theme followed by an underscore (genchstyle_). I change the message text, save my new function, clear my cache and load the confirmation message: no change. Why? Continue reading

Getting There…

Re-styling for responsive design is a ton of re-work. It’s much easier to build a website correctly the first time! I’ve still got about a day and a half of css tweaking ahead of me, but here are a few concrete tips for avoiding the pain I am experiencing…

1) Whenever possible, style repeatable components (e.g., menus and block views) so they’ll look good as they adapt to your responsive breakpoints.

Here is a sidebar component that is not very flexible. I will have to write and test separate css code for each breakpoint to make it work with my responsive layout…

Screen Shot 2013-07-25 at 11.05.09 AM Continue reading

Oops! I painted Myself Into a Corner

Here’s a lesson on how NOT to design a responsive website.

Don’t wait until the end of the project to think about it. Thinking about how your site will look and behave on mobile devices should be the first step in planning and designing a site. It should continue to be forefront in your mind during every layout and feature decision, especially anything having to do with menus and navigation.

When I started the gench site, I knew I wanted it to be responsive, so I did my homework and based the genchstyle theme on Omega. This was a good move, but the last time in the project that I focused on responsiveness. As I built and styled the site, I told myself “I’ll tweak the design for mobile devices once I get the ‘basic’ site built.” BIG mistake! Continue reading

Using PHP to Control Layout of a Drupal Webform

A webform’s layout can be controlled by PHP.

Say I want to take this webform…

Webform - before

Webform – before: the student’s name is on 3 separate lines

…and put the 3 Student’s name fields (Student’s first name, Student’s middle name & Student’s last name) on the same line together like this…

Webform – after

Webform – after: the student’s name is now on 1 line

Continue reading