April 2010

Apr 27 2010

Skinr: The ultimate module for themers?

Posted by amandar

Introduction
There has been a big buzz surrounding Skinr these days especially at Drupalcon SF 2010. There is also a lot of confusion about what it actually is and does. Being that the module was developed by my fellow employee Bala Bosh and the brain child of my sister Jacine Rodriguez, I have a unique view of Skinr. I'm not too involved to the point where I can't explain the basics and how its useful for every themer.

For those of you who don't know about Skinr, in a nutshell it is a module that allows the themer to preset specific styles for content that can be applied through the UI. You can control anything with skinr that has a preprocess function - the entire page, nodes, blocks, comments, views, panels. The kinds of things you can do are limited only by your imagination.

Since its conception, Skinr has grown into a robust powerful module that every themer should know about and use.

OK, so why should I use it?

Apr 30 2010

Skinr: How do I use this thing?

Posted by amandar

Intro
So you've installed Skinr and its required modules, now what?! The most common misconception about Skinr is that it contains CSS. Skinr doesn't come with any styles! Another common misconception is that Fusion and Skinr are the same thing, this is not so. Fusion is a theme that takes full advantage of the features of Skinr and thats it. Skinr is a tool that you need to take several steps in order to use.

Printing the $variables
The first place you should start is getting the variables to print. You can go straight to your template files and print the variable in the first div. However, I prefer to declare the Skinr variable in my preprocess functions. The way I do it is:

// Printing the Skinr variable
if($vars['skinr']) {
  $vars['block_attributes']['class'][] = $vars['skinr'];
}
// Combine attributes into a single string to be added to the block container.
$vars['attributes'] = theme('render_attributes', $vars['block_attributes']);