Thursday, August 30, 2012

Free Mobile Theme for Drupal 6

Mobile Mini is a mobile theme for Drupal 6 that I've created free for you to use.

In my previous post I showed you how to create a mobile site with Drupal 6 . I had spent some time to find a simple mobile theme, a simple and good looking one and as I could not find one I created one myself.




To download it here is the Google Docs Link:
Mobile Mini
Once you see the Google Docs page do Ctrl+S and it will be saved to a zip file in your computer

Installation

  1. Download the Mobile Mini theme
  2. Extract the contents to your sites/all/themes -folder.
  3. Enable the theme in Administer > Site building > Themes
This is really the first version of theme where on the front page you can only see the main Primary Links transformed into menu links.
The theme is light and it loads fast I will put some work into it soon, and as it is really simple you are free to modify it and change colors or styles as you want.

This is a GNU General Public License program just put a link to my site if you like it.
I've tested and it is working with the Mobile Tools module in one of my web sites , but remember there is no warranty.

Wednesday, August 29, 2012

Hack to Lighten Drupal 6 css Size

Even when using css agregator the size of the css file in a Drupal 6 site is too big.
Why? Because with every module Drupal has a tendency to load the module css style that goes with it.

You know how important is page speed for visitors and SEO also, so before doing any changes you may want to check your page speed and page size with Yslow or Page Speed plugins.

The lighter is your page, the faster it will load.

This trick is valable if you are using a diferent theme for the front page and let's say that for administration purposes you use Garland, so we are not goig to modify the admin Garland theme in this case as some of the functions related to styles classes with javascript may not work.

To lighten Drupal css sytle sheet, first you need to go to Performance setting and uncheck compress css styles.
Then open the template.php file on your active theme folder, for example if you are using the theme basic open the /sites/all/themes/basic/template.php file, but first of all make a copy of it!
Then find the preprocess_page function and add all the lines marked in pink:

function basic_preprocess_page(&$vars, $hook) {
  // Hack to lighten css
  $css = $vars['css'];
  unset($css['all']['module']['modules/system/defaults.css']);
  unset($css['all']['module']['modules/node/node.css']);
  unset($css['all']['module']['modules/system/admin.css']);
  unset($css['all']['module']['modules/system/system-menus.css']);
  unset($css['all']['module']['modules/user/user.css']);
// Modules installed by you
  unset($css['all']['module']['sites/all/modules/views/css/views.css']);
  unset($css['all']['module']['sites/all/modules/cck/theme/content-module.css']);
  unset($css['all']['module']['sites/all/modules/filefield/filefield.css']);
  unset($css['all']['module']['sites/all/modules/cck/modules/fieldgroup/fieldgroup.css']);
  $vars['styles'] = drupal_get_css($css);
  // end of hack

  // .. more code here
}

The path to sites/all/modules/ may change depending where you have installed your particular modules, if you are not sure of this do not include these lines.

Once you've done this go to Performance setting and check compress css styles back again.
Then check again speed and size of your page and see the difference.


Thanks to this trick my page loads 1 second faster!

Tuesday, August 28, 2012

Create a Mobile Site with Drupal 6

You can have your mobile site version with Drupal 6 real fast without programming. The Drupal module Mobile Tools will do everything you need.

Step 1: Create a subdomain of your site

Go to your domain hosting panel and create a subdomain of yous site:
http://m.website.com
You may have to wait a few hours, to know if your subdomain is active open a command line window and type:
ping my.website.com
if you see packet returns then your subdomain is active.

Step 2: Install Drupal 6 Mobile Tools and a theme for mobiles

Install a Drupal 6 theme for mobile
Goto: http://drupal.org/project/mobile_tools and follow instructions to install the Mobile Tools module. Active it in Drupal modules list.

Automatic redirecting

Go to <your web site>/admin/settings/mobile-tools and configure the automatic redirect
Whenever somebody is browsing your site with a mobile device your www.website.com url will be redirected to the m.website.com

Mobile Theme Switching

And now configure the theme that will be shown on a mobile device browser:

Go to: <your web site>/admin/settings/mobile-tools/theme-switching


And that's all, there is nothing else to do, whenever you browse our site with a mobile device it will work right away and you will see the mobile theme version with you original content!

Saturday, August 4, 2012

Solving Wifi Problems with Orange DSL

I had this long time problem: could not connect my IBM T42 to the Orange DSL via Wi-Fi.
I tried all the possible Wi-Fi configuration through the admin panel when this idea came to my mind:
Try the little Wireless adapter 802.11g, and it works!
I've just paid 7 euros for this adapter and it solved my problem.
Well, where was the problem?

My IBM T42 laptop has a Wi-Fi adapter with 802.11b working standards, I've tested my laptop everywhere and the Wi-Fi connection worked fine, but at home I had to use a R45 cable to connect to the Internet.

The Orange DSL has a Wi-Fi standard more recent than the standard of the Wi-Fi card on my laptop, even if the Orange admin dashboard you could select b/g or b/g/n, only g is working.

What is the difference between the 802.11b and 802.11g standards?

Wi-Fi Networking Standards Year

Speed


802.11b

1999

Up to 11 Mbps
802.11g

2002/2003

Up to 54 Mbps

Well, these speed values are theorethical figures which represents an ideal maximum only.
Usually, both standards are compatible but if you've got a router with 802.11g, and two computers conected one with a  802.11b adapter and the other with a 802.11g, the performance of the 802.11g may slow down to the 802.11b speed.
So it is better to have the same network standard with both the router and the clients.