XHTML

JStools CSS preventing IE browsers from loading default style.css in Drupal

It appears that loading the JStools tabs CSS @import derictive before the default line for CSS styles in a Drupal theme prevents the default styles from being applies in IE browsers (yes, including IE7 and IE8).

<style type="text/css" media="all">@import "/modules/jstools/tabs/tabs.css"</style>

I was able to zero-in on this particular line (above) by commenting out the &amp;lt;?php print $styles; ?&amp;gt; directive in the Drupal theme and instead hard-coded the tyle @import lines (you can get these by copying the source of your pages before you comment out $styles in our theme).

Armed with the @import directives in the source, I applied them all and then removed one by one and in blocks until I was able to isolate the line causing the problem.

Solution
Writing the default style file (style.css) before the tabs.css call will solve the problem. The simples way to implement this is to hard-code a link to styles.css before the

<?php print $styles; ?> call in the drupal theme. The only down-side to ths approach is the fact that you will end up with two calls t the style.css file, but that does not have visible effects visually, or in markup validity.

Adjusting element transparency in IE and Firefox

Standards compliant browsers (FF, Safari etc) and IE browsers require different CSS selector definitions to implement transparency. Here is what is necessary to set the following element to 50% transparency.

div#header
    {
        opacity: 0.5;
        filter: alpha(opacity = 50);
    }

PHP/Drupal code to generate CMS content as XML

There are two steps to the process:
- Trigger the alternative theme that writes XML
- Write the theme that renders XML

1)
In your page.tpl.php, add this code at the top

<?php
if (($_GET["format"])==("xml")) {
include 'xml.page.tpl.php'; /*call the alternative template file */
return; }
?>

In my case, I am looking to see if there is a querystring format=xml as a condition

Do the same for node.tpl.php and this time point to an alternative node.tpl.php

<?php
if (($_GET["format"])==("xml")) {
include 'xml.node.tpl.php'; /*call the alternative template file */
return; }
?>

2) The template files:
Example xml.page.tpl.php and xml.node.tpl.php (the naming format is arbitrary and can be anything)

<?php
$xml_header='<?xml version="1.0" encoding="ISO-8859-1"?>';
header('Content-type: text/xml');
print $xml_header;
?>
<drupal_page>
<?php print $content; ?>
</drupal_page>

and

<node>
<link><?php print $node_url ?></link>
<title><?php print $title ?></title>
<content><?php print $content ?></content>
</node>

There you go, test the code and correct any coding errors and it should work (I assume that you have already tested the implementation on cmsproducer.com). If you need help with this, please ask.

Please note that this code is just an example of greater things that you can accomplish by creatively theming CMS data. You call pull-in more fields, and even take the resultant XML and manipulate it using XSLT, or consume it into Adobe flash for presentation... If you come up with some creative application, please share them with th rest of us by commenting on this website, or on Drupal.org: Drupal to XML: By theme, Server-side manipulation

Valid XHTML 1.0 Strict
This site is accepts Oped ID authentication for login
This Website is Built Using Semantic Markup and Cascading Style Sheets (CSS)
Some usage rights are reserved, please contact us for approval before using it