IE6 and Ubertcart

There's a problem with Ubercart and any modules that use a great quantity of CSS files in Drupal. It doesnt seem to work in IE (any version).

You install Ubercart or any other big module in Drupal. you test it and seems fine in all the browsers , except IE (again, any version). Seems like some CSS files are missing.

WTF happened to my CSS! yelling is another sympthom of this IE induced disease

IE6 was created to support only 31 stylesheets if you use the link tag to insert them. So when you install ubercart, theres a big possibility that youre excedding that nonsense limit. Have a good day with that.

There are two ways to work this in Drupal without feelin like youre kicked in the nuts with an iron spiked shoe:
  • Im too young to die way (Easy Way): Just use unlimited css module, install it an forget about it. This module will call all the CSS files via an @import rule , you can have more thant 31 @import rules in IE, that why it work. Just as a side note, as a good web developer youre not supposed to use the @import rule because its mean trouble.
  • Hurt me plenty way (Medium Way): Activate the Css File Optimizer in Drupal. Go to admin/settings/performance and you will find the option Optimize the Css Files (duh!). This will mix all the css files in your web page to just one file. I couldnt make it work in my server, this option need a beefy machine to run so make sure you have a really reaaaaally fresh backup of your site before activating this.
You can also activate the Optimize the Javascript Code option, jsut remember to make a backup

So at least in Drupal there are ways to deal with it. Hey dont blame IE for teaching you about web server performance and making you lost 4 hours of your life yelling like a crazy schoolgirl before a Jonas Brothers concert.

Hate the Computers Gnomes, yeah thoses little rascals causing trouble again.

Change the Scayt language in Drupal CKEditor Module

This will be a short post about that dammed Spell Checker that comes active by default in the Ckeditor module of Drupal. Well as to this day the best WYSIWYG Module in Drupal 6 (for me) is Ckeditor. Its simple to install, fast as hell at least compared to Fckeditor, and easy to configure, except the SpellChecker plugin.

Yes Ckeditor has an SpellChecker, No its not easy to configure.

By Default the SpellChecker plugin is active, and in english, so i couldnt find a way to deactivate it but at least I found the way to change the language. Just search for the string 'en_US' in the file ckeditor.js and change it according to the idiom you want.For spanish is 'es_ES'. You will found this file in the real ckeditor directory , not in the module.

That file is a minimized version of ckeditor. You can found the source in '_source' directory, just in case you wonder what does the real ckeditor do.

Drupal Lightbox2 and Paging

So I had a strange problem with an ecommerce site Im developing. The site shows in the front page some products. The Owner told me to put a button with the magnifying glass over there, and when clicked, make it appear a modal box that shows more info of the product.

The Magnifying Glass in all it splendor

So hands at work, i use the lightbox2 and views module to make something like the owners command. The frontpage must show 8 products and if we have more, use a pager to navigate between products.

This is the pager, just in case youre asking what is a pager.

The problem? The view use paging so i show only the first eight products in the first page but if we go to the second page, problems occurs. The lightbox show all the modal boxes with the information of the first page. Oh god i smell some bug induced headache soon

The Solution
So after an entire day of debuging I found the problem: Lightbox2 is not taking in account the page you are when it retrieve the data. Basically lightbox2 use the load() function of jquery to get the WHOLE page it need to extract the info. The url of the page is inserted by lightbox2 usign the template in the file

You have to change the line 124 like this:

// We don't actually use the link, but we need it there for lightbox to function.
if (empty($link)) {
// Get the path name.
$path = isset($_GET['q']) ? $_GET['q'] : '';
//Created By Carlos


// We don't actually use the link, but we need it there for lightbox to function.
if (empty($link)) {
// Get the path name.
$path = isset($_GET['q']) ? $_GET['q'] : '';
//Created By Carlos
$path = $path .'?page='.$_GET['page'];
$link = url($path, array('absolute' => TRUE));

I just get the GET value of the current page and if it have a variable called page, append ?page= and the number of the page to the path that will be inserted in the lightbox trigger. Question anyone?