1
niroht
center logo in default theme
  • 2004/8/31 3:47

  • niroht

  • Just popping in

  • Posts: 3

  • Since: 2004/8/31


Hi, I've looked and looked and couldn't find an answer (that worked) for my question.

I use the default theme. I removed banners. I can't get my logo to be centered correctly. Something to do with the right column probably although I'm not sure why the left column doesn't cause a problem.

Quote:

<table cellspacing="0">
<tr id="header">
<td id="headerlogo">
<div align="center">
<a href="<{$xoops_url}>/">
<img src="<{$xoops_imageurl}>logo.jpg" width="512" height="115" alt="logo" />
</a>
</div>
</td>
</tr>
...
</table>
Is my code for the top logo. If you need more code or whatever please ask. I'd really like to be able to get my logo centered correctly.

2
incama
Re: center logo in default theme
  • 2004/8/31 4:13

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


Because the table hasn't any width it adjust his size to the picture which sits within. So centering the picture is of no use. You have define the table width to lets say 100% if you want to center the picture, or just center the table.

<table align="center" cellspacing="0">
<
tr id="header">
<
td id="headerlogo">
<
a href="<{$xoops_url}>/">
<
img src="<{$xoops_imageurl}>logo.jpg" width="512" height="115" alt="logo" />
</
a>
</
td>
</
tr>
...
</
table>

good luck

Incama

3
niroht
Re: center logo in default theme
  • 2004/8/31 4:38

  • niroht

  • Just popping in

  • Posts: 3

  • Since: 2004/8/31


Thanks, I've tried that though and it doesn't work. In fact, when I change it that way, it only aligns left. saying align center or right has no effect. I've tried width="100%" also, to no effect. It seems the right column extends all the way up and the header (where the logo is) sees that as the end of the page. align="center" works, it's just it's centered based on the fact that the right column is in it's way. If that makes any sence, hard to explain.

4
incama
Re: center logo in default theme
  • 2004/8/31 5:08

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


Could you post me the whole theme.html,,I guess it's a little thing that goes wrong.

btw, did you clear you cache in the template_c dir?

5
niroht
Re: center logo in default theme
  • 2004/8/31 5:25

  • niroht

  • Just popping in

  • Posts: 3

  • Since: 2004/8/31


I didn't clear the template_c cache manually, I have 'update module template .html files from themes/your theme/templates directory?' set to 'yes' which shows me changes I make; Like changing the align from left to right. Is that alright?

I got my logo to be correctly centered by removing the logo and makeing a banner with my logo picture. But that's only a work around, I'd rather not have to use my logo as a banner.

Here's my theme.html
Quote:
<!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="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<head>
<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="keywords" content="<{$xoops_meta_keywords}>" />
<meta name="description" content="<{$xoops_meta_description}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="XOOPS" />
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/xoops.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_themecss}>" />
<!-- RMV: added module header -->
<{$xoops_module_header}>
<script type="text/javascript">
<!--
<{$xoops_js}>
//-->
</script>
</head>
<body>
<table cellspacing="0">
<tr id="header">
<td id="headerlogo"><div align="center"><a href="<{$xoops_url}>/"><img src="<{$xoops_imageurl}>logo.jpg" width="512" height="115" alt="logo" /></a></div></td></tr>
<tr>
<td id="headerbar" colspan="1" background='/images/hbar_middle.gif' align='left'>&nbsp;<a href='/'>Forum</a>&nbsp;</td><td id="headerbar" colspan="1" background='/images/hbar_middle.gif' align='right'>&nbsp;<a href='/'>Home Page</a>&nbsp;</td></tr></table>
<table cellspacing="0">
<tr>
<td id="leftcolumn">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{include file="default/theme_blockleft.html"}>
<{/foreach}>
<!-- End left blocks loop -->

</td>

<td id="centercolumn">

<!-- Display center blocks if any -->
<{if $xoops_showcblock == 1}>

<table cellspacing="0">
<tr>
<td id="centerCcolumn" colspan="2">

<!-- Start center-center blocks loop -->
<{foreach item=block from=$xoops_ccblocks}>
<{include file="default/theme_blockcenter_c.html"}>
<{/foreach}>
<!-- End center-center blocks loop -->

</td>
</tr>
<tr>
<td id="centerLcolumn">

<!-- Start center-left blocks loop -->
<{foreach item=block from=$xoops_clblocks}>
<{include file="default/theme_blockcenter_l.html"}>
<{/foreach}>
<!-- End center-left blocks loop -->

</td><td id="centerRcolumn">

<!-- Start center-right blocks loop -->
<{foreach item=block from=$xoops_crblocks}>
<{include file="default/theme_blockcenter_r.html"}>
<{/foreach}>
<!-- End center-right blocks loop -->

</td>
</tr>
</table>

<{/if}>
<!-- End display center blocks -->

<div id="content">
<{$xoops_contents}>
</div>
</td>

<{if $xoops_showrblock == 1}>

<td id="rightcolumn">
<!-- Start right blocks loop -->
<{foreach item=block from=$xoops_rblocks}>
<{include file="default/theme_blockright.html"}>
<{/foreach}>
<!-- End right blocks loop -->
</td>

<{/if}>

</tr>
</table>

<table cellspacing="0">
<tr id="footerbar">
<td>.:.</td>
</tr>
</table>
</body>
</html>
I don't use the width 100% or the align in the <table> because it either has no effect or aligns it left no matter what. I've also tried moving the align from the div to the td, no change.

EDIT: also notice I've removed Quote:
<td id="headerbanner"><{$xoops_banner}></td>