XHTML
JStools CSS preventing IE browsers from loading default style.css in Drupal
Sat, 2008-04-05 20:00 — iDonnyIt 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 &lt;?php print $styles; ?&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
Wed, 2008-04-02 22:41 — iDonnyStandards 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
- 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; }
?>
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; }
?>
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>
<node>
<link><?php print $node_url ?></link>
<title><?php print $title ?></title>
<content><?php print $content ?></content>
</node>
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


