WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Internet Explorer 8: big display problems with the template

<< < (5/5)

midiweb:
hi,

I would like to post first here my current index.php and css file from the template directory "industry1" in order to have your opinion.


--- Code: ---<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
<head><title>Jurgschat-Consulting - Deutschland</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<!--<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>-->
</head>
<body>
<?php

// $Id: index.php 989 2009-06-15 13:12:39Z aldus $


$starttime = array_sum(explode(" ",microtime()));

// Include config file
require_once(dirname(__FILE__).&#39;/config.php&#39;);

// Check if the config file has been set-up
if(!defined(&#39;WB_PATH&#39;)) {
    header("Location: install/index.php");
    exit(0);
}

require_once(WB_PATH.&#39;/framework/class.frontend.php&#39;);
// Create new frontend object
$wb = new frontend();

// Figure out which page to display
// Stop processing if intro page was shown
$wb->page_select() or die();

// Collect info about the currently viewed page
// and check permissions
$wb->get_page_details();

// Collect general website settings
$wb->get_website_settings();

// Load functions available to templates, modules and code sections
// also, set some aliases for backward compatibility
require(WB_PATH.&#39;/framework/frontend.functions.php&#39;);

// redirect menu-link
$this_page_id = PAGE_ID;
if(version_compare(phpversion(), &#39;4.3&#39;, &#39;>=&#39;)) $php43 = TRUE; else $php43 = FALSE;
$query_this_module = $database->query("SELECT module, block FROM ".TABLE_PREFIX."sections WHERE page_id = &#39;$this_page_id&#39; AND module = &#39;menu_link&#39;");
if($query_this_module->numRows() == 1) { // This is a menu_link. Get link of target-page and redirect
    // get target_page_id
    $table = TABLE_PREFIX.&#39;mod_menu_link&#39;;
    $query_tpid = $database->query("SELECT * FROM $table WHERE page_id = &#39;$this_page_id&#39;");
    if($query_tpid->numRows() == 1) {
        $res=$query_tpid->fetchRow();
        $target_page_id = $res[&#39;target_page_id&#39;];
        $r_type = $res[&#39;redirect_type&#39;];
        $anchor = $res[&#39;anchor&#39;];
        $extern = $res[&#39;extern&#39;];
        if($anchor != &#39;0&#39;) $anchor = &#39;&#39;.$anchor;
        else $anchor = FALSE;
        // set redirect-type
        if($r_type==&#39;301&#39;) {
            if($php43) @header(&#39;HTTP/1.1 301 Moved Permanently&#39;, TRUE, 301);
            else @header(&#39;HTTP/1.1 301 Moved Permanently&#39;);
        }
        if($target_page_id == -1) {
            if($extern!=&#39;&#39;) {
                header("Location: $extern".($anchor?&#39;#&#39;.$anchor:&#39;&#39;));
            }
        } else {
            // get link of target-page
            $table = TABLE_PREFIX.&#39;pages&#39;;
            $query_link = $database->query("SELECT link FROM $table WHERE page_id = &#39;$target_page_id&#39;");
            if($query_link->numRows() == 1) {
                $res=$query_link->fetchRow();
                $target_page_link = $res[&#39;link&#39;];
                header(&#39;Location: &#39;.WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION.($anchor?&#39;#&#39;.$anchor:&#39;&#39;));
                exit;
            }
        }
    }
}

// Backwards compatible Frontend filter support
// include the output filter module routines
if(file_exists(WB_PATH .&#39;/modules/output_filter/filter-routines.php&#39;)) {@require_once(WB_PATH .&#39;/modules/output_filter/filter-routines.php&#39;);}
// Load Droplet engine
if(file_exists(WB_PATH .&#39;/modules/droplets/droplets.php&#39;)) { @require_once(WB_PATH .&#39;/modules/droplets/droplets.php&#39;); }

//Get pagecontent in buffer for Droplets and/or Filter operations
ob_start();
require(WB_PATH.&#39;/templates/&#39;.TEMPLATE.&#39;/index.php&#39;);
$output = ob_get_contents();
ob_end_clean();
if(function_exists(&#39;evalDroplets&#39;)) { $output = evalDroplets($output); }
if(function_exists(&#39;filter_frontend_output&#39;)) { $output = filter_frontend_output($output); }
echo $output;

?>
</body>
</html

--- End code ---

and the css industry file with a few changes from me:



--- Code: ---body {
font-family : Verdana, Geneva, Arial, helvetica, sans-serif;
font-size : 10pt;
padding : 0;
margin-top : 10px;
}
#nav {
width : 980px;
height : 22px;
border-top : 5px solid black;
position : relative;
margin : 0;
margin-top : 0px;
margin-bottom : 0px;
padding-left : 0px;
text-align : right;
background: url(../../media/oberrand.jpg) no-repeat;
}
#nav li {
padding-left : 16px;
padding-right : 10px;
display : inline;
height : 20px;
background: url(../../media/vertical2.jpg) no-repeat;
}
#nav li a {
color : black;
font : bold     normal normal 10px/20px "Lucida Grande", Lucida, Verdana, sans-serif;
}
#nav li a:hover
{
color: #cb1625;
}
#main {
font-family : Verdana, Geneva, Arial, helvetica, sans-serif;
font-size : 9pt;
width : 980px;
margin-left : auto;
margin-right : auto;
border-right : 1px solid #666666;
border-left : 1px solid #666666;
}
#hero {
margin : 0 10px;
width : 218px;
height : 106px;
background-image : url(../../media/jurgschatbanner.jpg);
background-repeat : no-repeat;
float : left;
}
#hero2 {
margin : 0;
margin-left: 286px;
margin-right: auto;
height : 106px;
background-image : url(../../media/topbanner3.jpg);
background-repeat : no-repeat;
}
.gear {
width : 970px;
height : 0px;
margin-top : 0;
margin-left : 15px;
}
#header h1 {
position : absolute;
left : 94px;
top : 8px;
color : white;
font-size : 48px;
font-weight : bold;
margin : 0;
}
#header em {
font-style : normal;
text-decoration : underline;
}
#wrapper {
display : inline;
padding-top : 0;
background-color : white;
position : relative;
}
/*#wrapper:after {
content : '.';
display : block;
height : 0;
clear : both;
visibility : hidden;
}*/
#sidebar {
float : left;
text-align : center;
margin-left : 0;
margin-top : 0;
position : relative;
padding : 10px 10px 20px 10px;
width : 160px;
height : 2850px;
border-right : 1px dotted ;
}
#aktuelles {
float : right;
text-align : center;
margin-left : 0;
margin-top : 0;
position : relative;
padding : 12px 10px 20px 10px;
width : 140px;
height : 2850px;
border-left : 1px dotted;
background-color: #e6e6e6;
}
#aktuelles h4 {
color : #232219;
text-align: center;
text-decoration: underline;
}
/*#sidebar h3 {
font-size : 18px;
border-bottom : 1px solid black;
margin-bottom : 4px;
margin-top : 16px;
clear : both;
}*/
#sidebar ul {
margin-left : 1em;
padding-left : 0;
}
#sidebar p {
margin-bottom : 8px;
}
#sidebar div.subtabs ul {
list-style : none;
width : 155px;
margin : 0;
padding : 0;
}
#sidebar div.subtabs ul ul {
list-style : none;
width : 130px;
margin : 0;
padding : 0 0 0 25px;
}
#sidebar div.subtabs ul ul ul {
list-style : none;
width : 125px;
margin : 0;
padding : 0 0 0 5px;
}
#sidebar div.subtabs ul a {
width : 100%;
margin : 3px;
text-align : left;
text-decoration : none;
display : block;
padding : 3px 3px 3px 5px;
border-bottom : 1px solid #949494;
border-left : 4px solid #cccccc;
font: bold 0.8em Verdana, Arial, Helvetica, sans-serif;
color: #0a0a0a;
}
#sidebar div.subtabs ul a:hover {
text-decoration : none;
background : #eaeaea url(img/menubg2.gif) repeat-x left;
color : #da0434;
border-left : 4px solid #110200;
}
#content {
margin : 0 0 0 180px;
min-height : 310px;
height : auto !important ;
width : 600px;
display : block;
position : relative;
padding : 0 3px 20px 10px;
color : #0b0b0b;
}
#content h1 {
font-size : 20px;
margin : 0;
}
#content h2 {
font-size : 18px;
margin : 0;
}
#content .date {
float : right;
}
#content .postedBy {
float : left;
}
#content .meta {
height : 1em;
}
#content p {
text-align : justify;
text-indent : 1em;
line-height : 1.3em;
}
/*.comments {
border-top : 1px dotted #666666;
border-bottom : 1px dotted #666666;
padding : 4px;
text-align : right;
margin-bottom : 2em;
background-image : url(images/comment_edit.gif);
background-repeat : no-repeat;
background-position : center left;
}*/
a {
color : #3c3b96;
}
/*.pullout {
background-color : #eeeeee;
padding : 5px;
float : right;
margin : 8px;
}*/
#footer {
margin-top: 0px;
width : 980px;
height : 38px;
padding-top : 0;
padding-bottom : 0;
margin-left : 0px;
margin-right : auto;
color : #6a72b5;
text-align : center;
background: url(../../media/bottombanner.jpg) no-repeat center;

}
.right {
float : right;
}
.csskeyword {
color : blue;
}
.cssvalue {
color : red;
}
p.caption {
text-align : center;
}
small.super {
vertical-align : top;
font-size : 0.75em;
line-height : 1.3em;
}
.nodisplay {
display : none;
}


--- End code ---

and now the index.php at the root :


--- Code: ---<?php

// $Id: index.php 989 2009-06-15 13:12:39Z aldus $


$starttime = array_sum(explode(" ",microtime()));

// Include config file
require_once(dirname(__FILE__).&#39;/config.php&#39;);

// Check if the config file has been set-up
if(!defined(&#39;WB_PATH&#39;)) {
    header("Location: install/index.php");
    exit(0);
}

require_once(WB_PATH.&#39;/framework/class.frontend.php&#39;);
// Create new frontend object
$wb = new frontend();

// Figure out which page to display
// Stop processing if intro page was shown
$wb->page_select() or die();

// Collect info about the currently viewed page
// and check permissions
$wb->get_page_details();

// Collect general website settings
$wb->get_website_settings();

// Load functions available to templates, modules and code sections
// also, set some aliases for backward compatibility
require(WB_PATH.&#39;/framework/frontend.functions.php&#39;);

// redirect menu-link
$this_page_id = PAGE_ID;
if(version_compare(phpversion(), &#39;4.3&#39;, &#39;>=&#39;)) $php43 = TRUE; else $php43 = FALSE;
$query_this_module = $database->query("SELECT module, block FROM ".TABLE_PREFIX."sections WHERE page_id = &#39;$this_page_id&#39; AND module = &#39;menu_link&#39;");
if($query_this_module->numRows() == 1) { // This is a menu_link. Get link of target-page and redirect
    // get target_page_id
    $table = TABLE_PREFIX.&#39;mod_menu_link&#39;;
    $query_tpid = $database->query("SELECT * FROM $table WHERE page_id = &#39;$this_page_id&#39;");
    if($query_tpid->numRows() == 1) {
        $res=$query_tpid->fetchRow();
        $target_page_id = $res[&#39;target_page_id&#39;];
        $r_type = $res[&#39;redirect_type&#39;];
        $anchor = $res[&#39;anchor&#39;];
        $extern = $res[&#39;extern&#39;];
        if($anchor != &#39;0&#39;) $anchor = &#39;&#39;.$anchor;
        else $anchor = FALSE;
        // set redirect-type
        if($r_type==&#39;301&#39;) {
            if($php43) @header(&#39;HTTP/1.1 301 Moved Permanently&#39;, TRUE, 301);
            else @header(&#39;HTTP/1.1 301 Moved Permanently&#39;);
        }
        if($target_page_id == -1) {
            if($extern!=&#39;&#39;) {
                header("Location: $extern".($anchor?&#39;#&#39;.$anchor:&#39;&#39;));
            }
        } else {
            // get link of target-page
            $table = TABLE_PREFIX.&#39;pages&#39;;
            $query_link = $database->query("SELECT link FROM $table WHERE page_id = &#39;$target_page_id&#39;");
            if($query_link->numRows() == 1) {
                $res=$query_link->fetchRow();
                $target_page_link = $res[&#39;link&#39;];
                header(&#39;Location: &#39;.WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION.($anchor?&#39;#&#39;.$anchor:&#39;&#39;));
                exit;
            }
        }
    }
}

// Backwards compatible Frontend filter support
// include the output filter module routines
if(file_exists(WB_PATH .&#39;/modules/output_filter/filter-routines.php&#39;)) {@require_once(WB_PATH .&#39;/modules/output_filter/filter-routines.php&#39;);}
// Load Droplet engine
if(file_exists(WB_PATH .&#39;/modules/droplets/droplets.php&#39;)) { @require_once(WB_PATH .&#39;/modules/droplets/droplets.php&#39;); }

//Get pagecontent in buffer for Droplets and/or Filter operations
ob_start();
require(WB_PATH.&#39;/templates/&#39;.TEMPLATE.&#39;/index.php&#39;);
$output = ob_get_contents();
ob_end_clean();
if(function_exists(&#39;evalDroplets&#39;)) { $output = evalDroplets($output); }
if(function_exists(&#39;filter_frontend_output&#39;)) { $output = filter_frontend_output($output); }
echo $output;

?>

--- End code ---


BUT when I don't write the doctype, the <html>, the <head> in the root index, my homepage is crappy and looks bad.

I mean I have to write the following code in  order to have a correct display:


--- Code: ---<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
<head><title>Jurgschat-Consulting - Deutschland</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<!--<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>-->
</head>
<body>
<?php
.......................
............................
.....................................
?>
</body>
</html>

--- End code ---

That 's why two bodies, two html and so on...

AND I go round in circles.... What I write in backend, what I insert is not what I get in the front end. It's because of FCKeditor.

who can advise me? Thanks. Sorry when some remarks are redundant...
Now I'm stuck here and can't go further.

Argos:
First of all: you should never have to edit the index.php in the WB root at all! Do not touch it unless you know exactly what and why you are doing.

Second: the code of the template index.php you posted contains weird stuff.

Third: you should never use multiple heads and body tags in one file.

Fourth: the "industry1" template is not part of the official repository. I only found it once in an old post in the forum, from 2007. I removed it from there. You'd better stop using it.

Look for another template that suits your wishes, from the official repository please.

midiweb:
Hi, thanx! I'll do it but how to adapt new template to an existing content?

The pages content stay thre same,   BUT can I use my current css sheet for a new existing template?

It´'s another post,..

Argos:

--- Quote from: midiweb on December 07, 2009, 01:16:48 PM ---Hi, thanx! I'll do it but how to adapt new template to an existing content?
The pages content stay thre same,   BUT can I use my current css sheet for a new existing template?

--- End quote ---

Modifying a template is just about the same as working on a static webpage.

You can only use basic visual styling elements from your current stylesheet, like colors and such. Every template is built differently, and uses its own structure and tags. The index.php and stylesheet are not two separate entities that you can swap at will, they belong together for that particular template. You should never use a complete stylesheet from another template. If you do, chances are almost 100% that you site will not look right, and probably will fail completely.

Navigation

[0] Message Index

[*] Previous page

Go to full version