Thursday, October 21, 2010

IE6 and 7 problems with arrangement of elements on the page

I had a background image that was showing up in front of a menu recently and had to adjust the z-index to make it show up properly in IE6 and 7.

Here's the fix:
http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/

IE7 and IE6 don't like list images

I've had to go look this up so many times, I thought I'd post it to my own blog. IE6 and 7 do funny things to list images. Instead of creating a different style just for those browsers, there is an easy fix.

First take out all references to list-style: image
Then change css to this:

ul, li { (or the id/class of this specific ul)
list-style: none;
margin: 0;
padding: 0; (if you don't already have this)
}

ul li {
padding-left: whatever
background: url(heart.gif) left center no-repeat;
}

Thursday, October 14, 2010

Configuring CKFinder in CFWheels

Russ Johnson has created a really nice plugin for ckeditor and markitup for CFWheels.

But I was using CKFinder on a project recently, and could not configure it with the jquery installation of ckeditor in the plugin.

So what I did was

install ckeditor (3.4.1) in the files directory
/files/ckeditor
then install ckfinder in the ckeditor directory
/files/ckeditor/ckfinder

then add the links to the javascript in the head of my main layout page
Since I use two environments, I did a check for my CGI.HTTP_HOST to make sure the paths are correct




If you aren't using two environments, you can include them in your javaScriptIncludeTag

then below the contentForLayout() tag, I added the javascript




Then every textarea that I need to use, I just use
textareaTag( name="editor1" )
It's not built into wheels like Russ' plugin so I can't use it as an object, but it's a simple matter to add
<cfset params.mycontroller.myfieldname = params.editor1> in my create or update actions


In my files/ckeditor/ckfinder/config.cfm file I had to make a few adjustments:


For testing purposes only, in my CheckAuthentication()
function, I returned true


You have to set your baseURL (the default is to use the userfiles folder in ckeditor


config.baseUrl = "/files/ckeditor/ckfinder/userfiles/";



and for some reason, I kept getting a file upload is corrupted message, so had to set


config.secureImageUploads = false ;



That was it. Pretty simple really.