Search

I am trying to write an extension for IE conditional css for ie bug fix. I created basic extension.driver.php and initaliseAdminPageHead callback. But i coudn’t find a way to insert conditional string to the head.

My Callback function like below :
` public function initaliseAdminPageHead($context) { $page = $context[‘parent’]->Page; $page->addStylesheetToHead(URL.’/extensions/iefix/assets/ie.css’,’screen’ ,69);

} `

But how i can produce the header tag like below. <!--[if IE]><link rel="stylesheet" type="text/css" media="screen" href="/workspace/assets/css/ie.css"/><![endif]-->

Isn’t this something that should be included/fixed in the core?

You should be able to do something like:

$this->addElementToHead(new XMLElement('!--[if IE]><link rel="stylesheet" href="'.URL.'/extensions/iefix/assets/ie.css" type="text/css"><![endif]--'), 69);

Symphony used to include a legacy.css for IE fixes, but this seems to have disappeared in my build. I know that Fazal has done some work on fixing the backend IE7, but I don’t know whether they’ve been integrated yet.

Dou you mean symphony already has a support for ie browsers at Admin backend.

As far as I know , there is no support for ie 7 and 8 browsers. When you go into the sections area all form materials broken.

There definitely used to be stylesheets for IE yes. I have it in some older builds. But it isn’t in 2.0.6. If it has been silently dropped then I’d be disappointed.

If the above does not work, you could use JavaScript to append the IE version as a body class, and use these in your selectors e.g. body.ie7.

tried and worked thanks nickdunn.

Here’s one of bauhouse’s ensembles from earlier in the year that includes a legacy.css. Might be useful.

http://github.com/bauhouse/sym-fluid960gs/blob/13951829aa962e044932402f5dca45d83580f1d3/symphony/assets/legacy.css

But I always thought that separate IE6, IE7 and IE8 stylesheets would be most sensible. 80% of IE6 bugs can be solved with display:inline (double-margin float bug) and zoom:1 (fixing hasLayout bugs).

If you don’t want to deal with a separate stylesheet, you can always add the IE specific hacks in the main CSS.

Like this:

 #myelement
 {
 color: #999; /* shows in all browsers */
 *color: #999; /* notice the * before the property - shows in IE7 and below */
 _color: #999; /* notice the _ before the property - shows in IE6 and below */
 }

If you don’t want to deal with a separate stylesheet, you can always add the IE specific hacks in the main CSS.

I really dislike those solutions. I think conditional comments are a much cleaner way of doing it.

old legacy.css is not enough for symphony 2.0.6. Some areas are still broken.

Better to use conditional comments to wrap the page with something IE specific:

<div id="ie" class="vX">...</div>

And write your IE specific rules like so:

#ie.v6 .some-selector.here { ... }

This way you can include your IE fixes directly after the normal CSS they are fixing.

Here’s what I use:

<body>
    <!--[if IE 8]><div id="ie" class="v8"><![endif]-->
    <!--[if IE 7]><div id="ie" class="v7"><![endif]-->
    <!--[if IE 6]><div id="ie" class="v6"><![endif]-->

    ...

    <!--[if (IE 6)|(IE 7)|(IE 8)]></div><![endif]-->
</body>

This way you can include your IE fixes directly after the normal CSS they are fixing.

It’s pedantic and off-topic, but I don’t favour this method for two reasons:

  1. You force all users to download IE-specific styles, which could run to several hundred lines for complex sites
  2. For a team of developers, particularly with SVN conflicts, I’ve found it much easier to work on separate files whereby one developer can be IE6 fixing using a separate file, in tandem with other CSS changes

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details