csshover.htc

Author Message

Massimo Sanna

Wednesday 21 September 2005 8:56:09 am

Hi there, I'm trying to serve a .htc file to IE (for dropdown menu hovering purposes). I tried to put just my mock-up in a normal folder of the webserver (apache 2) and it works, but when I try to serve this file through ezpublish it just doesn't work.
I tried to use the statement Addtype X-Text/component in httpd.conf, I tried with some rewritecond rules, and I enabled rewriterules to serve .htc files, but IE just ignores it.
I installed IE7 css behavior, as suggested by some people here on the forum, but it doesn't work as expected, it screws up my layout (I obviously removed my IE override css before applying it). Maybe next time i'll try to project it with IE7 from the beginning, but I would like to make csshover.htc working :(

Any ideas?

Gabriel Ambuehl

Wednesday 21 September 2005 11:58:49 am

You'll likely have to change your mod_rewrite rules so .htc Files are served by Apache, not redirected to ezpublish

Try to access the .htc file directly in the browser and see what happens. If ez complains about it not finding it, you'll know that mod_rewrite is the culprit.

Visit http://triligon.org

Massimo Sanna

Wednesday 21 September 2005 1:13:27 pm

Like I said in my first message, apache already serves directly .htc files through mod_rewrite, they're not redirected through ez publish. If I directly point to it I can download it.
But when loading a page which requires that .htc file, IE just ignores it and doesn't load the behavior.
Any idea?

Nathan Kelly

Thursday 22 September 2005 12:15:58 am

If IE7 didn't work you could always try the suckerfish approach http://www.htmldog.com/articles/suckerfish/ this is similar to IE7 but very light weight and pretty much dedicated to IE's lack of the :hover pseudo-class behaviour.

I've used it on a few sites now, though I havn't tried it with EzP there shouldn't be any dramas as it is just a small javascript file.

Hope this helps!

Cheers!

Pardon me while I burst into flames...

Gabriel Ambuehl

Thursday 22 September 2005 6:51:56 am

Suckerfish works with ez, I can confirm that.

Visit http://triligon.org

Massimo Sanna

Thursday 22 September 2005 11:51:45 am

I didn't want to use suckerfish because I don't like the javascript solution.
My solution using whatever:hover is better because you can serve pure css2 to standard compliant browsers, and you feed _just_ IE with a nice .htc that makes him aware of what :hover means.

Anyways I've been able to solve this today. I installed HTTPWatch for IE, a program which shows you every header, mime type and techy details for the page you're loading. In this way I discovered that:
1. csshover.htc was still being served as text/html, and since XP SP2, internet explorer refuses to load htc files with the wrong mime type.
2. passing through ez engine IE was taking the wrong path for csshover.htc

So my solution was to add the correct path in my body section (of the IE's specific css):

body {
    behavior: url(/design/sitename/stylesheets/csshover.htc);
}

after this I had to properly configure apache so that it took the correct mime time for the htc extension.

To do this I had to add the following line in httpd.conf (near other similar lines)

AddType text/x-component .htc 

Now it should be ok, but just for safety I added the same line in /etc/mime.types.

That's all!
Max

PS: by the way, to make the whole thing working you have to add the htc extension in the rewrite rule exceptions, otherwise ez will process the file instead of letting apache serve it.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.