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

Whats wrong with this code please ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-14-2008, 06:15 AM
 
circleofatlantis circleofatlantis is offline
 

Member
  
Join Date: May 2008
Location: Gold Coast, Australia
Posts: 21
 

Default Whats wrong with this code please ?

I'm trying to edit in a mouse over menu into home.tpl as someone suggested.

I'm obviously missing something as the page looks like a dogs breakfast now, but I cant pick what I'm missing.

What I've added in is in blue, the original file in black.

Can anyone help ?


Quote:
{* $Id: home.tpl,v 1.88.2.11 2007/08/08 13:51:54 max Exp $ *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{if $printable ne ''}
{include file="customer/home_printable.tpl"}
{else}
{config_load file="$skin_config"}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Type" content="text/html; >
<link href="common.css" rel="stylesheet" type="text/css">
<style type="text/css">

<title>{strip}
{capture name=title}
{if $config.SEO.page_title_format eq "A"}
{section name=position loop=$location}
{if not %position.first%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{else}
{section name=position loop=$location step=-1}
{if not %position.first%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{/if}
{/capture}
{if $config.SEO.page_title_limit <= 0}
{$smarty.capture.title}
{else}
{$smarty.capture.title|replace:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replac e:" ":"&nbsp;"}
{/if}
{/strip}</title>
{include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" />

A { text-decoration:none }
body {
font: 78%/1.5 arial, helvetica, serif;
background-color: #99ff99;
text-align: left;
padding: 0;
margin: 2em;
}



#container {
width: 95em;
background: #99ff99;
text-align: left;
border: 1px solid #1a446c;
margin: 0 auto;
}

p {
background: transparent;
margin: 1em 2em;
}

p#smurf {
background: transparent;
font-style: italic;
text-align: center;
font-weight: bold;
color: #99ff99;
}

#smurf strong {
font-size: 1.0em;
color: black;
}

h1 {
height: 18px;
text-indent: -999em;
margin: 1em 0 0 0;
}

#nav, #nav ul {
float: left;
width: 900px;
list-style: none;
line-height: 1;
background: white;
font-weight: bold;
padding: 0;
border: solid #1a446c;
border-width: 1px 0;
margin: 0 0 0em 0;
}

#nav a {
display: block;
width: 9em;
w\idth: 9em;
color: #000000;
text-decoration: none;
padding: 0.25em 2em;
}

#nav a.daddy {
background: url(rightarrow2.gif) center right no-repeat;
}

#nav li {
float: left;
padding: 0;
width: 8em;
}

#nav li ul {
position: absolute;
left: -999em;
height: auto;
width: 12.4em;
w\idth: 12.9em;
font-weight: normal;
border-width: 0.25em;
margin: 0;
}

#nav li li {
padding-right: .5em;
width: 10em
}

#nav li ul a {
width: 14em;
w\idth: 14em;
}

#nav li ul ul {
margin: -1.75em 0 0 13em;
}

#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul {
left: -999em;
}

#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
left: auto;
}

#nav li:hover, #nav li.sfhover {
background: #99ff99;
}

#content {
clear: left;
}

#content a {
color: #000000;
}

#content a:hover {
text-decoration: none;
}

#scaffolding {
height: 70px;
background: #99ff99;
border: solid #eda;
border-width: 1px 0 0 0;
margin: 1em 0 0 0;
}

#scaffolding a {
text-decoration: none;
text-indent: -999em;
display: block;
height: 70px;
background: url(/images/hdlogo_flip2.gif) no-repeat;
background-position: 181px 0;
}

#scaffolding a:hover {
background-position: 181px -70px;
}

</style>
<script type="text/javascript"><!--//--><![CDATA[//><!--

sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagNam e("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]></script>
<script charset="utf-8" id="injection_graph_func"
src="injection_graph_func.js"></script>
</head>
<body{$reading_direction_tag}{if $body_onload ne ''} onload="javascript: {$body_onload}"{/if}>
{include file="rectangle_top.tpl" }
{include file="head.tpl" }

<tbody>
<tr>
<td
style="white-space: nowrap; width: 947px; height: 585px; background-color: rgb(153, 255, 153);">
<div align="left">
<ul id="nav" align="left">
<li
style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-weight: bold;"><small><a
href="http://circleofatlantis.com">Home</a></small></li>
<li
style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-weight: bold;"><small><a
style="font-weight: bold;" href="">Forums/Blog</a></small>
<ul>
<li><a href="http://circleofatlantis.com/forum">CoA
Spiritual Forum</a></li>
<li><a href="http://circleofatlantis.com/soulmate">Soulmate
Forum</a></li>
<li><a href="http://circleofatlantis.com/sanctuary">Anwynns
Sanctuary</a></li>
<li><a href="http://circleofatlantis.com/blog">Blog </a> </li>
</ul>
</li>
<li
style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-weight: bold;"><small><a
href="">Ebooks</a></small>
<ul>
<li><a
href="http://circleofatlantis.com/forum/viewtopic.php?p=45">Life
Harmony</a></li>
<li><a
href="http://circleofatlantis.com/forum/viewtopic.php?p=47">Personal
Healing</a></li>
</ul>
</li>
<li
style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-weight: bold;"><small><a
href="http://circleofatlantis.com/fengshui/feng-shui.htm">Feng
Shui</a></small></li>
<li
style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-weight: bold;"><small><a
href="#">Shop</a></small>
<ul>
<li><a href="http://circleofatlantis.com/Products.php">Donations</a></li>
<li><a href="http://circleofatlantis.com/Products.php">Shopping
Cart</a></li>
<li><a href="http://circleofatlantis.com/photostore">Photostore</a></li>
<li><a href="http://astore.amazon.com/cirofatl-20">Amazon
Store</a> </li>
</ul>
</li>
<li style="background-color: rgb(255, 255, 255);"><small><a
style="color: rgb(0, 0, 0); font-weight: bold;" href="">Links</a></small>
<ul>
<li><a href="http://circleofatlantis.com/suggests">Suggested
Links</a></li>
<li><a href="http://circleofatlantis.com/links.html">General
Links</a></li>
<li><a href="http://circleofatlantis.com/Musings.html">Musings</a></li>
</ul>
</li>
<li style="background-color: rgb(255, 255, 255);"><small><a
style="color: rgb(0, 0, 0); font-weight: bold;" href="">About</a></small>
<ul>
<li><a
href="http://www.circleofatlantis.com/forum/viewtopic.php?t=27">Circle
of Atlantis</a></li>
<li><a href="http://circleofatlantis.com/timothy.html">Timothy
Ellis</a></li>
</ul>
</li>
</ul>
</div>
<tbody>


{if $active_modules.SnS_connector}
{include file="modules/SnS_connector/header.tpl"}
{/if}
<!-- main area -->
__________________
http://CircleofAtlantis.com/marketplace/
Xcart Version 4.1.9
Please bare with me. Ex-Analyst, ex-cobol, still teaching myself html, let alone anything else.
Reply With Quote
  #2  
Old 05-14-2008, 06:22 AM
 
balinor balinor is offline
 

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

Default Re: Whats wrong with this code please ?

Well first, all of the CSS styles need to go in the skin1.css stylesheet, don't embed them in the template.

Next, this is not correct:

content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Type" content="text/html; >
<link href="common.css" rel="stylesheet" type="text/css">
<style type="text/css">

Just get rid of all of that and append the contents of common.css to the main stylesheet.

Finally, the javascript probably needs to go in the head tag, and should be called from an external file, not embedded in the code.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-14-2008, 08:01 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Whats wrong with this code please ?

Quote:
Originally Posted by balinor
Well first, all of the CSS styles need to go in the skin1.css stylesheet, don't embed them in the template.

Next, this is not correct:

content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Type" content="text/html; >
<link href="common.css" rel="stylesheet" type="text/css">
<style type="text/css">

Just get rid of all of that and append the contents of common.css to the main stylesheet.

Finally, the javascript probably needs to go in the head tag, and should be called from an external file, not embedded in the code.

#nav a {
display: block;
width: 9em;
w\idth: 9em;
color: #000000;
text-decoration: none;
padding: 0.25em 2em;
}

and many else with w\idth:
............


</li>
</ul>
</div>
<tbody> (I think </tbody>) + need close tags</td></tr> after </div>

............

And many others.
Reply With Quote
  #4  
Old 05-14-2008, 05:12 PM
 
circleofatlantis circleofatlantis is offline
 

Member
  
Join Date: May 2008
Location: Gold Coast, Australia
Posts: 21
 

Default Re: Whats wrong with this code please ?

Quote:
and many else with w\idth:
............


I did wonder about those. The original code came from someone else, so I'm adapting something I copied.

That line never did make sense to me.

Are these redundant errors not taken out ?


Quote:
</li>
</ul>
</div>
<tbody> (I think </tbody>) + need close tags</td></tr> after </div>

Oops, yes the /tbody should have been obvious. I lose track of the td's and tr's too easily.

I'll correct this and see what difference it makes.

Quote:
Finally, the javascript probably needs to go in the head tag, and should be called from an external file, not embedded in the code.

err, can you give an example of what that looks like ?

Edit : Made the obvious changes including merging the stylesheets. Better, but still a dogs breakfast. I dont think the stylesheets were completely compatible.

Maybe I should be just asking if someone can do this for me and how much for ?
__________________
http://CircleofAtlantis.com/marketplace/
Xcart Version 4.1.9
Please bare with me. Ex-Analyst, ex-cobol, still teaching myself html, let alone anything else.
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 11:29 AM.

   

 
X-Cart forums © 2001-2020