Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

.htc file or "conditional comment" not recognized

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-22-2006, 04:18 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Red face .htc file or "conditional comment" not recognized

I am trying to implement the vertical drop-down CSS menus as coded by http://www.tanfa.co.uk/css/examples/menu/tutorial-v.asp

I can get it to work fine in an html file on my server, but when i try and insert the head code into home.tpl - no go. To the best of my knowledge the conditional comment or the call to the .htc file is not being interpreted correctly.

Below is the relavent code from the head tag of my home.tpl
Code:
{literal} <!--[if IE]> <style type="text/css" media="screen"> #nav ul li {float: left; width: 100%;} </style> <![endif]--> <!--[if lt IE 7]> <style type="text/css" media="screen"> body { behavior: url(/xcart/skin1/skin1_csshover.htc); font-size: 100%; } #nav ul li {float: left; width: 100%;} #nav ul li a {height: 1%;} #nav a { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } </style> <![endif]--> {/literal}

my home page is http://amazonmedicine.com/xcart/home.php

please note that the "<!--[if IE]>" is a "conditional comment" to handle exceptions with internet explorer - I think it is the IE 7 conditional that is not working because other versions of IE seem to be working. If the conditional is working then the reference to the .htc file is not being interpreted. FYI the .htc file modifies how the css is translated/executed. Yes permissions are 777 on the .htc file for what it is worth.

thanks for any insights or general guidance
__________________
Version 4.1.3
Reply With Quote
  #2  
Old 08-24-2006, 11:24 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default Re: .htc file or "conditional comment" not recognized

Well I figured out the problem.

It turns out the the conditional internet explorer ifs and the htc file were being referenced correctly.

The problem is that CSS behaves differently depending on the DOCTYPE so I went with the following xhtml doctype:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

FINALLY i got crossbrowser CSS multi-level popup menus that just work! But I heard in another thread that using xhtml as a doctype is "pushing it" I hope that is not the case with the version I am using...

PS this whole business about conditional comments is only recognized in Internet Explorer - so if someone is using ie then you can change how the page displays - just like a smarty if statement.

more about conditional comments here: http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp
__________________
Version 4.1.3
Reply With Quote
  #3  
Old 08-25-2006, 03:23 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: .htc file or "conditional comment" not recognized

If you use xhtml as the doctype much of the xcart code won't validate so you'll get a lot of errors.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 08-25-2006, 08:20 AM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default Re: .htc file or "conditional comment" not recognized

Well I got it to work with the following doctype so I don't have to use xhtml - phew!

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Just wondering - If the browsers comes up with errors "validating" but still displays the page properly what is wrong with that?

Thanks for you help.
__________________
Version 4.1.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:32 AM.

   

 
X-Cart forums © 2001-2020