Dylan Tack's blog

Creating theme-independant, custom markup for your Views

August 29, 2008

The Drupal Views module has powerful theming abilities. CSS classes abound, allowing you to accomplish a great deal with stylesheets alone. If that's not enough for you, custom phptemplate files can be added to your theme. The new Views 2 will even helpfully suggest a list of possible template files (under Basic Settings -> Theme: Information).

Wouldn't it be nice, though, if you could have custom markup independent of the theme? Or perhaps you'd like to apply your custom styles more selectively to just certain views or view displays?
With hook_views_plugins(), you can.

Improving the security of Drupal's securepages module

July 24, 2008

A common scenario we encounter is where the bulk of a site's traffic is anonymous users, for whom it would be an unnecessary burden on the server to transfer pages with SSL. However, it is still desirable to serve some parts of the site with SSL (typically the admin pages, or perhaps some commerce-related pages). Luckily, the securepages module accomplishes this nicely.

This approach has a drawback, however. The same session cookie is used to access both SSL and non-SSL pages. Since this cookie is passed around in plaintext, it's easily hijacked by an attacker, who can then access your SSL-protected pages with the hijacked session.