Skip to content

Using Kalatheme and Best Practices

schasoli edited this page Sep 21, 2014 · 2 revisions

Kalatheme is different than a lot of Drupal themes so if you are used to using something else you might want to take the time to review both the best practices here and the subsequent feature areas below.

Best Practices - Learn them, love them, live them

  1. Keep it Simple

One of major goals of Kalatheme was to reduce the amount of files needed to make a great theme while increasing the themes maintainability. To this end, a normal and well put together Kalatheme subtheme should aim to have less than 10 total css, js and template files.

  1. Start with Something Close

Now that you can use easily import a custom Bootstrap library, it's important to start with the stylings and grid that are closest to your needs. This will save you a lot of time and increase the maintainability of your site in the long run.

  1. Use the Styles Plugin!

One of the things we really wanted to get rid of in Kalatheme was lots of repetitive CSS designed to target specific blocks or panes. Make 4-5 robust panes stlyes and leverage them using our Styles Plugin.

  1. Use One Region and Panels Layouts

We try to use the least amount of template files as possible. To that end you should make good use of panels pages and panelizer so that you can leverage all of the awesome layouts provided by Panopoly Theme. If you need a layout not provided by Panopoly, create a custom one. Generally you will want your page template file to contain the static elements of your site which may be a header and footer but could be more or neither. Most layout considerations should be done on the panels side. We try not to turn block.module on or use context but if you need something in between hard coding static elements into a template file and panels panes it is OK to add more regions to your template and use something like context or display suite.

  1. Don't go insane with device visibility toggling

With Kalatheme you can hide any panels pane on any device using our responsive toggling. This, however, is not a substitute for good design. Try to use this sparingly as it will still load the entire pane and its contents. Make sure if you are hiding a pane with images that those images are as small as possible. If after awhile you realize you are using this feature A LOT it is likely that you have effectively made a separate mobile site which means you no longer really have a responsive site. At this point you might want to consider alternative options. You could use breakpoint_panels to not render any panel, redesign or make a separate mobile theme.

Features - See links below!