...

View Full Version : Table Columns containing PHP not aligning on page



KellyFaith
03-12-2010, 03:36 PM
All,

I edited a joomla template to fix a table, which was successful, but now the columns are misaligned and I can't seem to figure out why, no matter what I do. HELP!

Here is my page showing the problem: http://www.hondugringo.com/joomla/index.php?option=com_simplelists&view=simplelist&layout=table&category_id=51&Itemid=122

Here is my code:

<?php defined('_JEXEC') or die('Restricted access'); ?><?php echo SimplelistsHelper::loadTemplate('_header'); ?><?php if( !empty( $this->simplelist )) : ?>

<table width="622" border="1"><?php foreach( $this->simplelist as $item ): ?>
<tr class="simplelists-item"> <td width="200" rowspan="3" align="left" valign="top" nowrap="nowrap" ><?php if($item->picture): ?>
<?php echo $item->picture; ?>
<?php endif; ?>
<br/>
<a name="<?php echo $item->href; ?>" id="<?php echo $item->href; ?>2"></a>
<?php if($item->title): ?>
<h3 class="contentheading"><?php echo $item->title; ?></h3>
<?php endif; ?>
<?php if($item->text): ?>
<?php echo $item->text; ?>
<?php endif; ?>
<?php if($item->readmore): ?>
<br/>
<?php echo $item->readmore; ?>
<?php endif; ?>
<?php if($this->totop): ?>
<td width="200">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
</table>
<?php endif; ?>
<?php endforeach; ?>
</table>
<?php else: ?>
<?php echo $this->empty_list; ?>
<?php endif; ?>
<?php echo SimplelistsHelper::loadTemplate('_footer'); ?>


And here is my CSS:

/**
* Joomla! 1.5 component Simple Lists
*
* @author Yireo
* @copyright Copyright (C) 2008 Yireo
* @license GNU/GPL
* @link https://www.yireo.com/
*/

/* begin com_simplelists: table layout */
table.simplelists {
width: 100%;
padding-bottom: 50px ;
}

table.simplelists th {
}

table.simplelists td {
padding: 5px ;
float:left
}

table.simplelists td img {
margin-top: 25px ;
border: 0 ;
}

a.totop img {
border: 0;
}

/* end com_simplelists */

DaiLaughing
03-12-2010, 03:44 PM
As I said in the HTML/CSS forum you would be better off showing us the generated HTML because the most likely problem seems to be a missing closing TD tag.

http://www.codingforums.com/showthread.php?t=191258

KellyFaith
03-12-2010, 03:47 PM
Here is the resulting 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-gb" lang="en-gb" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Jeremy Umbaugh, Honduras, missions, street kids, missionary, compassion, el sembrador, farm school, tegucigalpa, catacamas" />
<meta name="description" content="My personal website done in a Joomla environment." />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Staff</title>
<link rel="stylesheet" href="/joomla/components/com_simplelists/css/table.css" type="text/css" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<script type="text/javascript" src="/joomla/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/joomla/media/system/js/modal.js"></script>
<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});

$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
</script>

<link rel="stylesheet" href="/joomla/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="/joomla/templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="/joomla/templates/copy/css/template.css" />
<!--[if IE 6]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie7.css" type="text/css" media="screen" /><![endif]-->
<script type="text/javascript" src="/joomla/templates/copy/script.js"></script>
</head>
<body>
<div id="art-page-background-gradient"></div>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu"><li class="item55"><a href="http://www.hondugringo.com/joomla/"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a></li><li class="item56"><a href="/joomla/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=5&amp;Itemid=56"><span class="l"> </span><span class="r"> </span><span class="t">History</span></a></li><li class="item70"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=56&amp;Itemid=70"><span class="l"> </span><span class="r"> </span><span class="t">Students</span></a></li><li class="item57"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=57"><span class="l"> </span><span class="r"> </span><span class="t">Staff</span></a></li><li class="item64"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=64"><span class="l"> </span><span class="r"> </span><span class="t">Work Teams</span></a></li><li class="item62"><a href="/joomla/index.php?option=com_weblinks&amp;view=category&amp;id=38&amp;Itemid=62"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a></li><li class="item124"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=64&amp;Itemid=124"><span class="l"> </span><span class="r"> </span><span class="t">Photo Gallery</span></a></li><li class="item68"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=43&amp;Itemid=68"><span class="l"> </span><span class="r"> </span><span class="t">Contact Us</span></a></li></ul></div>


<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="/joomla/"></a></h1>
<div id="slogan-text" class="art-Logo-text"></div>
</div>


</div>

<div class="art-contentLayout">
<div class="art-content">

<div class="art-Post">
<div class="art-Post-body">
<div class="art-Post-inner">

<div class="art-PostContent">


<a name="top"></a>
<h1 class="componentheading">Staff</h1>


<div class="simplelists-category">
<span id="simplelists-description"></span>
</div>





<div class="simplelists-pagecounter">
</div>


<div class="simplelists-pagecounter">
</div>

<table border="1" width="622">
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top" nowrap="nowrap">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Andy Yessensa Garcia.jpg" alt="Andy Yessensa Garcia" title="Andy Yessensa Garcia" class="simplelists" width="108" height="144" />
<br/>
<a name="andy-yessensa-garcia" id="andy-yessensa-garcia"></a>
<p style="text-align: left;"><strong>Andy Yessensa Garcia<br /></strong><em>Kitchen</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top" nowrap="nowrap">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Carlos Zuniga.jpg" alt="Carlos Zuniga" title="Carlos Zuniga" class="simplelists" width="108" height="144" />
<br/>
<a name="carlos-zuniga" id="carlos-zuniga"></a>
<p style="text-align: left;"><strong>Carlos Zuniga<br /></strong><em>Production Manager</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top" nowrap="nowrap">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Carmen Alicia Cruz.jpg" alt="Carmen Alicia Cruz" title="Carmen Alicia Cruz" class="simplelists" width="108" height="144" />
<br/>
<a name="carmen-alicia-cruz" id="carmen-alicia-cruz"></a>
<p style="text-align: left;"><strong>Carmen Alicia Cruz</strong><br /><em>Secretary</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top" nowrap="nowrap">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Gueyvi Gabriela Mejia.jpg" alt="Gueyvi Gabriela Mejia" title="Gueyvi Gabriela Mejia" class="simplelists" width="108" height="144" />
<br/>
<a name="gueyvi-gabriela-mejia" id="gueyvi-gabriela-mejia"></a>
<p style="text-align: left;"><strong>Gueyvi Gabriela Mejia<br /></strong><em>Event Coordinator</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top" nowrap="nowrap">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Mina Isabel Duron.jpg" alt="Mina Isabel Durón" title="Mina Isabel Durón" class="simplelists" width="108" height="144" />
<br/>
<a name="mina-isabel-duron" id="mina-isabel-duron"></a>
<p style="text-align: left;"><strong>Mina Isabel Durón</strong><br /><em>Kitchen</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top" nowrap="nowrap">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Sandy Gabriela Velasquez C.jpg" alt="Sandy Gabriela Velasquez C" title="Sandy Gabriela Velasquez C" class="simplelists" width="108" height="144" />
<br/>
<a name="sandy-gabriela-velasquez-c" id="sandy-gabriela-velasquez-c"></a>
<p style="text-align: left;"><strong>Sandy Gabriela Velásquez C.<br /></strong><em>Utilities Accountant</em></p> </table>



<div class="simplelists-pagenavigation">
</div>


</div>
<div class="cleared"></div>


</div>

<div class="cleared"></div>
</div>
</div>



</div>
<div class="art-sidebar1"><div class="art-Block">
<div class="art-Block-tl"></div>
<div class="art-Block-tr"></div>
<div class="art-Block-bl"></div>
<div class="art-Block-br"></div>
<div class="art-Block-tc"></div>
<div class="art-Block-bc"></div>
<div class="art-Block-cl"></div>
<div class="art-Block-cr"></div>
<div class="art-Block-cc"></div>
<div class="art-Block-body">

<div class="art-BlockContent">
<div class="art-BlockContent-tl"></div>
<div class="art-BlockContent-tr"></div>
<div class="art-BlockContent-bl"></div>
<div class="art-BlockContent-br"></div>
<div class="art-BlockContent-tc"></div>
<div class="art-BlockContent-bc"></div>
<div class="art-BlockContent-cl"></div>
<div class="art-BlockContent-cr"></div>
<div class="art-BlockContent-cc"></div>
<div class="art-BlockContent-body">

<ul class="menu"><li id="current" class="active item122"><a href="/joomla/index.php?option=com_simplelists&amp;view=simplelist&amp;layout=table&amp;category_id=51&amp;Itemid=122"><span>Staff</span></a></li><li class="parent item60"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=62&amp;Itemid=60"><span>Missionaries</span></a></li><li class="parent item61"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=63&amp;Itemid=61"><span>Volunteers</span></a></li></ul>
<div class="cleared"></div>
</div>
</div>


<div class="cleared"></div>
</div>
</div>

</div>

</div>
<div class="cleared"></div>


<div class="art-Footer">
<div class="art-Footer-inner">
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" type="text" size="20" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div>
<input type="hidden" name="task" value="search" />
<input type="hidden" name="option" value="com_search" />
</form> <div class="art-Footer-text">


Copyright &copy; 2010 Escuela El Sembrador


</div>
</div>
<div class="art-Footer-background"></div>
</div>
<div class="cleared"></div></div></div><div class="cleared"></div><p class="art-page-footer">
<a style="display:none" href="http://www.cmsplaza.com" title="CMS Plaza">Website CMS Joomla</a>
<p><a style="display:none" href="http://www.joomlapublisher.com" title="Joomla Publisher">Joomla Extensions Directory Listing</a></p></div>

</body>
</html>

tomws
03-12-2010, 04:52 PM
It looks like you didn't close any td or tr tags. That will break everything.

KellyFaith
03-12-2010, 05:00 PM
You're right that the resulting html does not have the closing tags, but take look at the original php code. They are there, but why aren't they coming through in the resulting html?

Fou-Lu
03-12-2010, 05:11 PM
This is clearly an HTML issue then.
Merging these threads together.


Hah, nvm then looks like I can't merge into a client forum. Please continue the disussion on the above issue within the HTML/CSS forum.

tomws
03-12-2010, 05:17 PM
Unless I'm missing something, no, the tds aren't being closed in that loop. Additionally, look here:

</tr>
</table>
<?php endif; ?>
<?php endforeach; ?>
</table>

You do have a tr close, but also a table close. Problem? It's inside the foreach, so it's attempting to close a row which contains unclosed cells, and then it's attempting to close the table multiple times. I don't see that in the rendered HTML, but the browser may have just given up trying. :D

Remove that table close inside the foreach and add a td close inside. See if that helps.


EDIT: Oops. Sorry, Fou. I was in reply when you posted. Looks like some PHP issue, if I'm seeing it correctly.

KellyFaith
03-12-2010, 05:28 PM
Thanks for the tip. I removed the extra table closing tag, but it did not effect the output.

Here is the resulting html with the extra closing tag removed....still no td or tr closing tags.


<!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-gb" lang="en-gb" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Jeremy Umbaugh, Honduras, missions, street kids, missionary, compassion, el sembrador, farm school, tegucigalpa, catacamas" />
<meta name="description" content="My personal website done in a Joomla environment." />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Staff</title>
<link rel="stylesheet" href="/joomla/components/com_simplelists/css/table.css" type="text/css" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<script type="text/javascript" src="/joomla/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/joomla/media/system/js/modal.js"></script>
<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});

$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
</script>

<link rel="stylesheet" href="/joomla/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="/joomla/templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="/joomla/templates/copy/css/template.css" />
<!--[if IE 6]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie7.css" type="text/css" media="screen" /><![endif]-->
<script type="text/javascript" src="/joomla/templates/copy/script.js"></script>
</head>
<body>
<div id="art-page-background-gradient"></div>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu"><li class="item55"><a href="http://www.hondugringo.com/joomla/"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a></li><li class="item56"><a href="/joomla/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=5&amp;Itemid=56"><span class="l"> </span><span class="r"> </span><span class="t">History</span></a></li><li class="item70"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=56&amp;Itemid=70"><span class="l"> </span><span class="r"> </span><span class="t">Students</span></a></li><li class="item57"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=57"><span class="l"> </span><span class="r"> </span><span class="t">Staff</span></a></li><li class="item64"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=64"><span class="l"> </span><span class="r"> </span><span class="t">Work Teams</span></a></li><li class="item62"><a href="/joomla/index.php?option=com_weblinks&amp;view=category&amp;id=38&amp;Itemid=62"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a></li><li class="item124"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=64&amp;Itemid=124"><span class="l"> </span><span class="r"> </span><span class="t">Photo Gallery</span></a></li><li class="item68"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=43&amp;Itemid=68"><span class="l"> </span><span class="r"> </span><span class="t">Contact Us</span></a></li></ul></div>


<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="/joomla/"></a></h1>
<div id="slogan-text" class="art-Logo-text"></div>
</div>


</div>

<div class="art-contentLayout">
<div class="art-content">

<div class="art-Post">
<div class="art-Post-body">
<div class="art-Post-inner">

<div class="art-PostContent">


<a name="top"></a>
<h1 class="componentheading">Staff</h1>


<div class="simplelists-category">
<span id="simplelists-description"></span>
</div>





<div class="simplelists-pagecounter">
</div>



<div class="simplelists-pagecounter">
</div>

<table border="1" width="622">
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Andy Yessensa Garcia.jpg" alt="Andy Yessensa Garcia" title="Andy Yessensa Garcia" class="simplelists" width="108" height="144" />
<br>
<a name="andy-yessensa-garcia" id="andy-yessensa-garcia"></a>
<p style="text-align: left;"><strong>Andy Yessensa Garcia<br /></strong><em>Kitchen</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Carlos Zuniga.jpg" alt="Carlos Zuniga" title="Carlos Zuniga" class="simplelists" width="108" height="144" />
<br>
<a name="carlos-zuniga" id="carlos-zuniga"></a>
<p style="text-align: left;"><strong>Carlos Zuniga<br /></strong><em>Production Manager</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Carmen Alicia Cruz.jpg" alt="Carmen Alicia Cruz" title="Carmen Alicia Cruz" class="simplelists" width="108" height="144" />
<br>
<a name="carmen-alicia-cruz" id="carmen-alicia-cruz"></a>
<p style="text-align: left;"><strong>Carmen Alicia Cruz</strong><br /><em>Secretary</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Gueyvi Gabriela Mejia.jpg" alt="Gueyvi Gabriela Mejia" title="Gueyvi Gabriela Mejia" class="simplelists" width="108" height="144" />
<br>
<a name="gueyvi-gabriela-mejia" id="gueyvi-gabriela-mejia"></a>
<p style="text-align: left;"><strong>Gueyvi Gabriela Mejia<br /></strong><em>Event Coordinator</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Mina Isabel Duron.jpg" alt="Mina Isabel Durón" title="Mina Isabel Durón" class="simplelists" width="108" height="144" />
<br>
<a name="mina-isabel-duron" id="mina-isabel-duron"></a>
<p style="text-align: left;"><strong>Mina Isabel Durón</strong><br /><em>Kitchen</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Sandy Gabriela Velasquez C.jpg" alt="Sandy Gabriela Velasquez C" title="Sandy Gabriela Velasquez C" class="simplelists" width="108" height="144" />
<br>
<a name="sandy-gabriela-velasquez-c" id="sandy-gabriela-velasquez-c"></a>
<p style="text-align: left;"><strong>Sandy Gabriela Velásquez C.<br /></strong><em>Utilities Accountant</em></p> </table>



<div class="simplelists-pagenavigation">
</div>


</div>
<div class="cleared"></div>


</div>

<div class="cleared"></div>
</div>
</div>



</div>
<div class="art-sidebar1"><div class="art-Block">
<div class="art-Block-tl"></div>
<div class="art-Block-tr"></div>
<div class="art-Block-bl"></div>
<div class="art-Block-br"></div>
<div class="art-Block-tc"></div>
<div class="art-Block-bc"></div>
<div class="art-Block-cl"></div>
<div class="art-Block-cr"></div>
<div class="art-Block-cc"></div>
<div class="art-Block-body">

<div class="art-BlockContent">
<div class="art-BlockContent-tl"></div>
<div class="art-BlockContent-tr"></div>
<div class="art-BlockContent-bl"></div>
<div class="art-BlockContent-br"></div>
<div class="art-BlockContent-tc"></div>
<div class="art-BlockContent-bc"></div>
<div class="art-BlockContent-cl"></div>
<div class="art-BlockContent-cr"></div>
<div class="art-BlockContent-cc"></div>
<div class="art-BlockContent-body">

<ul class="menu"><li id="current" class="active item122"><a href="/joomla/index.php?option=com_simplelists&amp;view=simplelist&amp;layout=table&amp;category_id=51&amp;Itemid=122"><span>Staff</span></a></li><li class="parent item60"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=62&amp;Itemid=60"><span>Missionaries</span></a></li><li class="parent item61"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=63&amp;Itemid=61"><span>Volunteers</span></a></li></ul>
<div class="cleared"></div>
</div>
</div>


<div class="cleared"></div>
</div>
</div>

</div>

</div>
<div class="cleared"></div>


<div class="art-Footer">
<div class="art-Footer-inner">
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" type="text" size="20" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div>
<input type="hidden" name="task" value="search" />
<input type="hidden" name="option" value="com_search" />
</form> <div class="art-Footer-text">


Copyright &copy; 2010 Escuela El Sembrador


</div>
</div>
<div class="art-Footer-background"></div>
</div>
<div class="cleared"></div></div></div><div class="cleared"></div><p class="art-page-footer">
<a style="display:none" href="http://www.cmsplaza.com" title="CMS Plaza">Website CMS Joomla</a>
<p><a style="display:none" href="http://www.joomlapublisher.com" title="Joomla Publisher">Joomla Extensions Directory Listing</a></p></div>

</body>
</html>

tomws
03-12-2010, 05:40 PM
Thanks for the tip. I removed the extra table closing tag, but it did not effect the output.

Here is the resulting html with the extra closing tag removed....still no td or tr closing tags.


But did you add the </td>? Go ahead and post the current code along with the HTML, too. Then we can compare.

KellyFaith
03-12-2010, 05:52 PM
Here is the current php code, including closing tags.


<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php echo SimplelistsHelper::loadTemplate('_header'); ?>
<?php if( !empty( $this->simplelist )) : ?>

<div class="simplelists-pagecounter">
</div>

<table border="1" width="622">
<?php foreach( $this->simplelist as $item ): ?>
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">
<?php if($item->picture): ?>
<?php echo $item->picture; ?>
<?php endif; ?> <br>
<a name="<?php echo $item->href; ?>" id="<?php echo $item->href; ?>"></a>
<?php if($item->title): ?>
<h3 class="contentheading">
<?php echo $item->title; ?></h3>
<?php endif; ?>
<?php if($item->text): ?>
<?php echo $item->text; ?>
<?php endif; ?>
<?php if($item->readmore): ?>
<?php echo $item->readmore; ?>
<?php endif; ?>
<?php if($this->totop): ?>
</td>


<td width="200" align="left" rowspan="3" valign="top"></td>
<td width="200" align="left" rowspan="3" valign="top"></td>
</tr>

<?php endif; ?><?php endforeach; ?></table>
<?php else: ?> <?php echo $this->empty_list; ?><?php endif; ?><?php echo SimplelistsHelper::loadTemplate('_footer'); ?>

Here is the current html result with closing tags omitted.


<!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-gb" lang="en-gb" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Jeremy Umbaugh, Honduras, missions, street kids, missionary, compassion, el sembrador, farm school, tegucigalpa, catacamas" />
<meta name="description" content="My personal website done in a Joomla environment." />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Staff</title>
<link rel="stylesheet" href="/joomla/components/com_simplelists/css/table.css" type="text/css" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<script type="text/javascript" src="/joomla/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/joomla/media/system/js/modal.js"></script>
<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});

$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
</script>

<link rel="stylesheet" href="/joomla/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="/joomla/templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="/joomla/templates/copy/css/template.css" />
<!--[if IE 6]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie7.css" type="text/css" media="screen" /><![endif]-->
<script type="text/javascript" src="/joomla/templates/copy/script.js"></script>
</head>
<body>
<div id="art-page-background-gradient"></div>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu"><li class="item55"><a href="http://www.hondugringo.com/joomla/"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a></li><li class="item56"><a href="/joomla/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=5&amp;Itemid=56"><span class="l"> </span><span class="r"> </span><span class="t">History</span></a></li><li class="item70"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=56&amp;Itemid=70"><span class="l"> </span><span class="r"> </span><span class="t">Students</span></a></li><li class="item57"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=57"><span class="l"> </span><span class="r"> </span><span class="t">Staff</span></a></li><li class="item64"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=64"><span class="l"> </span><span class="r"> </span><span class="t">Work Teams</span></a></li><li class="item62"><a href="/joomla/index.php?option=com_weblinks&amp;view=category&amp;id=38&amp;Itemid=62"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a></li><li class="item124"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=64&amp;Itemid=124"><span class="l"> </span><span class="r"> </span><span class="t">Photo Gallery</span></a></li><li class="item68"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=43&amp;Itemid=68"><span class="l"> </span><span class="r"> </span><span class="t">Contact Us</span></a></li></ul></div>


<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="/joomla/"></a></h1>
<div id="slogan-text" class="art-Logo-text"></div>
</div>


</div>

<div class="art-contentLayout">
<div class="art-content">

<div class="art-Post">
<div class="art-Post-body">
<div class="art-Post-inner">

<div class="art-PostContent">


<a name="top"></a>
<h1 class="componentheading">Staff</h1>


<div class="simplelists-category">
<span id="simplelists-description"></span>
</div>





<div class="simplelists-pagecounter">
</div>



<div class="simplelists-pagecounter">
</div>

<table border="1" width="622">
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Andy Yessensa Garcia.jpg" alt="Andy Yessensa Garcia" title="Andy Yessensa Garcia" class="simplelists" width="108" height="144" />
<br>
<a name="andy-yessensa-garcia" id="andy-yessensa-garcia"></a>
<p style="text-align: left;"><strong>Andy Yessensa Garcia<br /></strong><em>Kitchen</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Carlos Zuniga.jpg" alt="Carlos Zuniga" title="Carlos Zuniga" class="simplelists" width="108" height="144" />
<br>
<a name="carlos-zuniga" id="carlos-zuniga"></a>
<p style="text-align: left;"><strong>Carlos Zuniga<br /></strong><em>Production Manager</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Carmen Alicia Cruz.jpg" alt="Carmen Alicia Cruz" title="Carmen Alicia Cruz" class="simplelists" width="108" height="144" />
<br>
<a name="carmen-alicia-cruz" id="carmen-alicia-cruz"></a>
<p style="text-align: left;"><strong>Carmen Alicia Cruz</strong><br /><em>Secretary</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Gueyvi Gabriela Mejia.jpg" alt="Gueyvi Gabriela Mejia" title="Gueyvi Gabriela Mejia" class="simplelists" width="108" height="144" />
<br>
<a name="gueyvi-gabriela-mejia" id="gueyvi-gabriela-mejia"></a>
<p style="text-align: left;"><strong>Gueyvi Gabriela Mejia<br /></strong><em>Event Coordinator</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Mina Isabel Duron.jpg" alt="Mina Isabel Durón" title="Mina Isabel Durón" class="simplelists" width="108" height="144" />
<br>
<a name="mina-isabel-duron" id="mina-isabel-duron"></a>
<p style="text-align: left;"><strong>Mina Isabel Durón</strong><br /><em>Kitchen</em></p> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Sandy Gabriela Velasquez C.jpg" alt="Sandy Gabriela Velasquez C" title="Sandy Gabriela Velasquez C" class="simplelists" width="108" height="144" />
<br>
<a name="sandy-gabriela-velasquez-c" id="sandy-gabriela-velasquez-c"></a>
<p style="text-align: left;"><strong>Sandy Gabriela Velásquez C.<br /></strong><em>Utilities Accountant</em></p> </table>



<div class="simplelists-pagenavigation">
</div>


</div>
<div class="cleared"></div>


</div>

<div class="cleared"></div>
</div>
</div>



</div>
<div class="art-sidebar1"><div class="art-Block">
<div class="art-Block-tl"></div>
<div class="art-Block-tr"></div>
<div class="art-Block-bl"></div>
<div class="art-Block-br"></div>
<div class="art-Block-tc"></div>
<div class="art-Block-bc"></div>
<div class="art-Block-cl"></div>
<div class="art-Block-cr"></div>
<div class="art-Block-cc"></div>
<div class="art-Block-body">

<div class="art-BlockContent">
<div class="art-BlockContent-tl"></div>
<div class="art-BlockContent-tr"></div>
<div class="art-BlockContent-bl"></div>
<div class="art-BlockContent-br"></div>
<div class="art-BlockContent-tc"></div>
<div class="art-BlockContent-bc"></div>
<div class="art-BlockContent-cl"></div>
<div class="art-BlockContent-cr"></div>
<div class="art-BlockContent-cc"></div>
<div class="art-BlockContent-body">

<ul class="menu"><li id="current" class="active item122"><a href="/joomla/index.php?option=com_simplelists&amp;view=simplelist&amp;layout=table&amp;category_id=51&amp;Itemid=122"><span>Staff</span></a></li><li class="parent item60"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=62&amp;Itemid=60"><span>Missionaries</span></a></li><li class="parent item61"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=63&amp;Itemid=61"><span>Volunteers</span></a></li></ul>
<div class="cleared"></div>
</div>
</div>


<div class="cleared"></div>
</div>
</div>

</div>

</div>
<div class="cleared"></div>


<div class="art-Footer">
<div class="art-Footer-inner">
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" type="text" size="20" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div>
<input type="hidden" name="task" value="search" />
<input type="hidden" name="option" value="com_search" />
</form> <div class="art-Footer-text">


Copyright &copy; 2010 Escuela El Sembrador


</div>
</div>
<div class="art-Footer-background"></div>
</div>
<div class="cleared"></div></div></div><div class="cleared"></div><p class="art-page-footer">
<a style="display:none" href="http://www.cmsplaza.com" title="CMS Plaza">Website CMS Joomla</a>
<p><a style="display:none" href="http://www.joomlapublisher.com" title="Joomla Publisher">Joomla Extensions Directory Listing</a></p></div>

</body>
</html>

tomws
03-12-2010, 06:09 PM
Look here:

<?php if($this->totop): ?>
</td>


<td width="200" align="left" rowspan="3" valign="top"></td>
<td width="200" align="left" rowspan="3" valign="top"></td>
</tr>

<?php endif; ?>

The td and tr closers are placed inside your if. Move them outside - probably before it(?).

Why do you have 2 "back to top" cells?

tomws
03-12-2010, 06:10 PM
Ack! No, not both of them before. Put the td before and the tr after.

KellyFaith
03-12-2010, 06:23 PM
OK, if I understood you correctly, this is what you're after:



<table border="1" width="622">
<?php foreach( $this->simplelist as $item ): ?>
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>
<?php if($item->picture): ?>
<?php echo $item->picture; ?>
<?php endif; ?> <br>
<a name="<?php echo $item->href; ?>" id="<?php echo $item->href; ?>"></a>
<?php if($item->title): ?>
<h3 class="contentheading">
<?php echo $item->title; ?></h3>
<?php endif; ?>
<?php if($item->text): ?>
<?php echo $item->text; ?>
<?php endif; ?>
<?php if($item->readmore): ?>
<?php echo $item->readmore; ?>
<?php endif; ?>
<?php if($this->totop): ?>
<td width="200" align="left" rowspan="3" valign="top"></td>
<td width="200" align="left" rowspan="3" valign="top"></td>
<?php endif; ?>
</tr>


The resulting html code does include the closing tags now, but now all the items are listed in a single column down the page.

Resulting HTML

<!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-gb" lang="en-gb" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Jeremy Umbaugh, Honduras, missions, street kids, missionary, compassion, el sembrador, farm school, tegucigalpa, catacamas" />
<meta name="description" content="My personal website done in a Joomla environment." />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Staff</title>
<link rel="stylesheet" href="/joomla/components/com_simplelists/css/table.css" type="text/css" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<script type="text/javascript" src="/joomla/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/joomla/media/system/js/modal.js"></script>
<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});

$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
</script>

<link rel="stylesheet" href="/joomla/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="/joomla/templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="/joomla/templates/copy/css/template.css" />
<!--[if IE 6]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie7.css" type="text/css" media="screen" /><![endif]-->
<script type="text/javascript" src="/joomla/templates/copy/script.js"></script>
</head>
<body>
<div id="art-page-background-gradient"></div>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu"><li class="item55"><a href="http://www.hondugringo.com/joomla/"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a></li><li class="item56"><a href="/joomla/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=5&amp;Itemid=56"><span class="l"> </span><span class="r"> </span><span class="t">History</span></a></li><li class="item70"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=56&amp;Itemid=70"><span class="l"> </span><span class="r"> </span><span class="t">Students</span></a></li><li class="item57"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=57"><span class="l"> </span><span class="r"> </span><span class="t">Staff</span></a></li><li class="item64"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=64"><span class="l"> </span><span class="r"> </span><span class="t">Work Teams</span></a></li><li class="item62"><a href="/joomla/index.php?option=com_weblinks&amp;view=category&amp;id=38&amp;Itemid=62"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a></li><li class="item124"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=64&amp;Itemid=124"><span class="l"> </span><span class="r"> </span><span class="t">Photo Gallery</span></a></li><li class="item68"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=43&amp;Itemid=68"><span class="l"> </span><span class="r"> </span><span class="t">Contact Us</span></a></li></ul></div>


<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="/joomla/"></a></h1>
<div id="slogan-text" class="art-Logo-text"></div>
</div>


</div>

<div class="art-contentLayout">
<div class="art-content">

<div class="art-Post">
<div class="art-Post-body">
<div class="art-Post-inner">

<div class="art-PostContent">


<a name="top"></a>
<h1 class="componentheading">Staff</h1>


<div class="simplelists-category">
<span id="simplelists-description"></span>
</div>





<div class="simplelists-pagecounter">
</div>


<div class="simplelists-pagecounter">
</div>
<table border="1" width="622">
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>

<img src="http://www.hondugringo.com/joomla//images/simplelists/Andy Yessensa Garcia.jpg" alt="Andy Yessensa Garcia" title="Andy Yessensa Garcia" class="simplelists" width="108" height="144" />
<br>
<a name="andy-yessensa-garcia" id="andy-yessensa-garcia"></a>
<p style="text-align: left;"><strong>Andy Yessensa Garcia<br /></strong><em>Kitchen</em></p> </tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>

<img src="http://www.hondugringo.com/joomla//images/simplelists/Carlos Zuniga.jpg" alt="Carlos Zuniga" title="Carlos Zuniga" class="simplelists" width="108" height="144" />
<br>
<a name="carlos-zuniga" id="carlos-zuniga"></a>
<p style="text-align: left;"><strong>Carlos Zuniga<br /></strong><em>Production Manager</em></p> </tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>

<img src="http://www.hondugringo.com/joomla//images/simplelists//Carmen Alicia Cruz.jpg" alt="Carmen Alicia Cruz" title="Carmen Alicia Cruz" class="simplelists" width="108" height="144" />
<br>
<a name="carmen-alicia-cruz" id="carmen-alicia-cruz"></a>
<p style="text-align: left;"><strong>Carmen Alicia Cruz</strong><br /><em>Secretary</em></p> </tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>

<img src="http://www.hondugringo.com/joomla//images/simplelists//Gueyvi Gabriela Mejia.jpg" alt="Gueyvi Gabriela Mejia" title="Gueyvi Gabriela Mejia" class="simplelists" width="108" height="144" />
<br>
<a name="gueyvi-gabriela-mejia" id="gueyvi-gabriela-mejia"></a>
<p style="text-align: left;"><strong>Gueyvi Gabriela Mejia<br /></strong><em>Event Coordinator</em></p> </tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>

<img src="http://www.hondugringo.com/joomla//images/simplelists/Mina Isabel Duron.jpg" alt="Mina Isabel Durón" title="Mina Isabel Durón" class="simplelists" width="108" height="144" />
<br>
<a name="mina-isabel-duron" id="mina-isabel-duron"></a>
<p style="text-align: left;"><strong>Mina Isabel Durón</strong><br /><em>Kitchen</em></p> </tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top"> </td>

<img src="http://www.hondugringo.com/joomla//images/simplelists/Sandy Gabriela Velasquez C.jpg" alt="Sandy Gabriela Velasquez C" title="Sandy Gabriela Velasquez C" class="simplelists" width="108" height="144" />
<br>
<a name="sandy-gabriela-velasquez-c" id="sandy-gabriela-velasquez-c"></a>
<p style="text-align: left;"><strong>Sandy Gabriela Velásquez C.<br /></strong><em>Utilities Accountant</em></p> </tr></table>



<div class="simplelists-pagenavigation">
</div>


</div>
<div class="cleared"></div>


</div>

<div class="cleared"></div>
</div>
</div>



</div>
<div class="art-sidebar1"><div class="art-Block">
<div class="art-Block-tl"></div>
<div class="art-Block-tr"></div>
<div class="art-Block-bl"></div>
<div class="art-Block-br"></div>
<div class="art-Block-tc"></div>
<div class="art-Block-bc"></div>
<div class="art-Block-cl"></div>
<div class="art-Block-cr"></div>
<div class="art-Block-cc"></div>
<div class="art-Block-body">

<div class="art-BlockContent">
<div class="art-BlockContent-tl"></div>
<div class="art-BlockContent-tr"></div>
<div class="art-BlockContent-bl"></div>
<div class="art-BlockContent-br"></div>
<div class="art-BlockContent-tc"></div>
<div class="art-BlockContent-bc"></div>
<div class="art-BlockContent-cl"></div>
<div class="art-BlockContent-cr"></div>
<div class="art-BlockContent-cc"></div>
<div class="art-BlockContent-body">

<ul class="menu"><li id="current" class="active item122"><a href="/joomla/index.php?option=com_simplelists&amp;view=simplelist&amp;layout=table&amp;category_id=51&amp;Itemid=122"><span>Staff</span></a></li><li class="parent item60"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=62&amp;Itemid=60"><span>Missionaries</span></a></li><li class="parent item61"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=63&amp;Itemid=61"><span>Volunteers</span></a></li></ul>
<div class="cleared"></div>
</div>
</div>


<div class="cleared"></div>
</div>
</div>

</div>

</div>
<div class="cleared"></div>


<div class="art-Footer">
<div class="art-Footer-inner">
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" type="text" size="20" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div>
<input type="hidden" name="task" value="search" />
<input type="hidden" name="option" value="com_search" />
</form> <div class="art-Footer-text">


Copyright &copy; 2010 Escuela El Sembrador


</div>
</div>
<div class="art-Footer-background"></div>
</div>
<div class="cleared"></div></div></div><div class="cleared"></div><p class="art-page-footer">
<a style="display:none" href="http://www.cmsplaza.com" title="CMS Plaza">Website CMS Joomla</a>
<p><a style="display:none" href="http://www.joomlapublisher.com" title="Joomla Publisher">Joomla Extensions Directory Listing</a></p></div>

</body>
</html>

tomws
03-12-2010, 06:30 PM
OK, if I understood you correctly, this is what you're after: Not quite. You moved the td close tag, but way too far. It should have been placed just before this, I think:

<?php if($this->totop): ?>


The resulting html code does include the closing tags now, but now all the items are listed in a single column down the page.

Well, yes. What did you expect? That's what a table does.

KellyFaith
03-12-2010, 06:35 PM
I want the items listed across 3 columns, rather than one column, which is why this template had a table with 3 columns. Any advice?

KellyFaith
03-12-2010, 06:40 PM
Here's the resulting html for the moved td tag. I think we're back to where we started.


<!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-gb" lang="en-gb" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Jeremy Umbaugh, Honduras, missions, street kids, missionary, compassion, el sembrador, farm school, tegucigalpa, catacamas" />
<meta name="description" content="My personal website done in a Joomla environment." />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Staff</title>
<link rel="stylesheet" href="/joomla/components/com_simplelists/css/table.css" type="text/css" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<script type="text/javascript" src="/joomla/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/joomla/media/system/js/modal.js"></script>
<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});

$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
</script>

<link rel="stylesheet" href="/joomla/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="/joomla/templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="/joomla/templates/copy/css/template.css" />
<!--[if IE 6]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie7.css" type="text/css" media="screen" /><![endif]-->
<script type="text/javascript" src="/joomla/templates/copy/script.js"></script>
</head>
<body>
<div id="art-page-background-gradient"></div>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu"><li class="item55"><a href="http://www.hondugringo.com/joomla/"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a></li><li class="item56"><a href="/joomla/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=5&amp;Itemid=56"><span class="l"> </span><span class="r"> </span><span class="t">History</span></a></li><li class="item70"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=56&amp;Itemid=70"><span class="l"> </span><span class="r"> </span><span class="t">Students</span></a></li><li class="item57"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=57"><span class="l"> </span><span class="r"> </span><span class="t">Staff</span></a></li><li class="item64"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=64"><span class="l"> </span><span class="r"> </span><span class="t">Work Teams</span></a></li><li class="item62"><a href="/joomla/index.php?option=com_weblinks&amp;view=category&amp;id=38&amp;Itemid=62"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a></li><li class="item124"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=64&amp;Itemid=124"><span class="l"> </span><span class="r"> </span><span class="t">Photo Gallery</span></a></li><li class="item68"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=43&amp;Itemid=68"><span class="l"> </span><span class="r"> </span><span class="t">Contact Us</span></a></li></ul></div>


<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="/joomla/"></a></h1>
<div id="slogan-text" class="art-Logo-text"></div>
</div>


</div>

<div class="art-contentLayout">
<div class="art-content">

<div class="art-Post">
<div class="art-Post-body">
<div class="art-Post-inner">

<div class="art-PostContent">


<a name="top"></a>
<h1 class="componentheading">Staff</h1>


<div class="simplelists-category">
<span id="simplelists-description"></span>
</div>





<div class="simplelists-pagecounter">
</div>


<div class="simplelists-pagecounter">
</div>
<table border="1" width="622">
<tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Andy Yessensa Garcia.jpg" alt="Andy Yessensa Garcia" title="Andy Yessensa Garcia" class="simplelists" width="108" height="144" />
<br>
<a name="andy-yessensa-garcia" id="andy-yessensa-garcia"></a>
<p style="text-align: left;"><strong>Andy Yessensa Garcia<br /></strong><em>Kitchen</em></p> </td>
</tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Carlos Zuniga.jpg" alt="Carlos Zuniga" title="Carlos Zuniga" class="simplelists" width="108" height="144" />
<br>
<a name="carlos-zuniga" id="carlos-zuniga"></a>
<p style="text-align: left;"><strong>Carlos Zuniga<br /></strong><em>Production Manager</em></p> </td>
</tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Carmen Alicia Cruz.jpg" alt="Carmen Alicia Cruz" title="Carmen Alicia Cruz" class="simplelists" width="108" height="144" />
<br>
<a name="carmen-alicia-cruz" id="carmen-alicia-cruz"></a>
<p style="text-align: left;"><strong>Carmen Alicia Cruz</strong><br /><em>Secretary</em></p> </td>
</tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists//Gueyvi Gabriela Mejia.jpg" alt="Gueyvi Gabriela Mejia" title="Gueyvi Gabriela Mejia" class="simplelists" width="108" height="144" />
<br>
<a name="gueyvi-gabriela-mejia" id="gueyvi-gabriela-mejia"></a>
<p style="text-align: left;"><strong>Gueyvi Gabriela Mejia<br /></strong><em>Event Coordinator</em></p> </td>
</tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Mina Isabel Duron.jpg" alt="Mina Isabel Durón" title="Mina Isabel Durón" class="simplelists" width="108" height="144" />
<br>
<a name="mina-isabel-duron" id="mina-isabel-duron"></a>
<p style="text-align: left;"><strong>Mina Isabel Durón</strong><br /><em>Kitchen</em></p> </td>
</tr> <tr class="simplelists-item">
<td width="180" rowspan="3" align="left" valign="top">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Sandy Gabriela Velasquez C.jpg" alt="Sandy Gabriela Velasquez C" title="Sandy Gabriela Velasquez C" class="simplelists" width="108" height="144" />
<br>
<a name="sandy-gabriela-velasquez-c" id="sandy-gabriela-velasquez-c"></a>
<p style="text-align: left;"><strong>Sandy Gabriela Velásquez C.<br /></strong><em>Utilities Accountant</em></p> </td>
</tr></table>



<div class="simplelists-pagenavigation">
</div>


</div>
<div class="cleared"></div>


</div>

<div class="cleared"></div>
</div>
</div>



</div>
<div class="art-sidebar1"><div class="art-Block">
<div class="art-Block-tl"></div>
<div class="art-Block-tr"></div>
<div class="art-Block-bl"></div>
<div class="art-Block-br"></div>
<div class="art-Block-tc"></div>
<div class="art-Block-bc"></div>
<div class="art-Block-cl"></div>
<div class="art-Block-cr"></div>
<div class="art-Block-cc"></div>
<div class="art-Block-body">

<div class="art-BlockContent">
<div class="art-BlockContent-tl"></div>
<div class="art-BlockContent-tr"></div>
<div class="art-BlockContent-bl"></div>
<div class="art-BlockContent-br"></div>
<div class="art-BlockContent-tc"></div>
<div class="art-BlockContent-bc"></div>
<div class="art-BlockContent-cl"></div>
<div class="art-BlockContent-cr"></div>
<div class="art-BlockContent-cc"></div>
<div class="art-BlockContent-body">

<ul class="menu"><li id="current" class="active item122"><a href="/joomla/index.php?option=com_simplelists&amp;view=simplelist&amp;layout=table&amp;category_id=51&amp;Itemid=122"><span>Staff</span></a></li><li class="parent item60"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=62&amp;Itemid=60"><span>Missionaries</span></a></li><li class="parent item61"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=63&amp;Itemid=61"><span>Volunteers</span></a></li></ul>
<div class="cleared"></div>
</div>
</div>


<div class="cleared"></div>
</div>
</div>

</div>

</div>
<div class="cleared"></div>


<div class="art-Footer">
<div class="art-Footer-inner">
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" type="text" size="20" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div>
<input type="hidden" name="task" value="search" />
<input type="hidden" name="option" value="com_search" />
</form> <div class="art-Footer-text">


Copyright &copy; 2010 Escuela El Sembrador


</div>
</div>
<div class="art-Footer-background"></div>
</div>
<div class="cleared"></div></div></div><div class="cleared"></div><p class="art-page-footer">
<a style="display:none" href="http://www.cmsplaza.com" title="CMS Plaza">Website CMS Joomla</a>
<p><a style="display:none" href="http://www.joomlapublisher.com" title="Joomla Publisher">Joomla Extensions Directory Listing</a></p></div>

</body>
</html>

tomws
03-12-2010, 06:48 PM
I want the items listed across 3 columns, rather than one column, which is why this template had a table with 3 columns. Any advice?

That would have been useful information to start with.


Here's the resulting html for the moved td tag. I think we're back to where we started.


No, it's not the same. The rows and cells are closed.

I wouldn't do this with a table, but if you insist on doing it that way, you're going to need to modify the code. You'll need to stick with a loop and implement a modulus test to determine which "column" use. It might look something like this (in php and pseudo-code):


$itemcounter = 0;
foreach( $this->simplelist as $item )
{
if ($itemcounter % 3 == 0)
{
// open tr
}

// open td
// show $item stuff
// close td

$itemcounter++;

if ($itemcounter % 3 == 0)
{
// close tr
}
}

I think that logic is correct. Something close, anyway.

KellyFaith
03-12-2010, 07:03 PM
And where in my file would I place this code?

FYI, I didn't choose to do it this way. This was a template that I modified to add a column.

tomws
03-12-2010, 07:27 PM
You wouldn't place it anywhere. It's intended as a suggestion, a guide for how to modify what you already have.

Are you saying that this was already working to display a two-column table? If so, show that unmodified code. It may be easy to patch that up.

KellyFaith
03-12-2010, 07:34 PM
Good idea. Here is the original code:


<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php echo SimplelistsHelper::loadTemplate('_header'); ?>

<?php if( !empty( $this->simplelist )) : ?>

<table class="<?php echo $this->page_class; ?>">
<?php foreach( $this->simplelist as $item ): ?>

<tr class="simplelists-item">
<td valign="middle" align="center" class="simplelists-item-left">
<?php if($item->picture): ?>
<?php echo $item->picture; ?>
<?php endif; ?>
</td>
<td valign="top" class="simplelists-item-right">

<a name="<?php echo $item->href; ?>"></a>

<?php if($item->title): ?>
<h3 class="contentheading"><?php echo $item->title; ?></h3>
<?php endif; ?>

<?php if($item->text): ?>
<?php echo $item->text; ?>
<?php endif; ?>

<?php if($item->readmore): ?>
<br/><?php echo $item->readmore; ?>
<?php endif; ?>

</td>
</tr>
<?php if($this->totop): ?>
<tr>
<td colspan="2">
<?php echo $this->totop; ?>
</td>
</tr>
<?php endif; ?>

<?php endforeach; ?>
</table>
<?php else: ?>
<?php echo $this->empty_list; ?>
<?php endif; ?>

<?php echo SimplelistsHelper::loadTemplate('_footer'); ?>

tomws
03-12-2010, 07:54 PM
I guess I'm an idiot. This looks like it will just generate a table with a single result per row, not 2 results per row like you say it does. Is a page online somewhere that uses this version?

KellyFaith
03-12-2010, 08:13 PM
You're not an idiot...you are correct. However, in IE 6.0 it showed in two columns, but now when I open it in 8.0, it displays as a single column as you found.

So, how can I modify this to display the items in 3 columns?

tomws
03-12-2010, 08:37 PM
In that case, you'd need to rewrite the loop using logic similar to post #17.

KellyFaith
03-12-2010, 09:07 PM
OK, as you've noticed, I am new to PHP and I've never written my own...just modified others.

So, here is what I wrote.


<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php echo SimplelistsHelper::loadTemplate('_header'); ?>
<?php if( !empty( $this->simplelist )) : ?>
<?php $itemcounter =0; ?>
<?php foreach( $this->simplelist as $item ) ?>
<?php if ($itemcounter % 3 ==0) ?>
<table>
<tr class ="simplelists-item">
<td width="180">
<?php if($item->picture): ?>
<?php echo $item->picture; ?>
<?php endif; ?> <br>
<a name="<?php echo $item->href; ?>" id="<?php echo $item->href; ?>"></a>
<?php if($item->title): ?>
<h3 class="contentheading">
<?php echo $item->title; ?></h3>
<?php endif; ?>
<?php if($item->text): ?>
<?php echo $item->text; ?>
<?php endif; ?>
<?php if($item->readmore): ?>
<?php echo $item->readmore; ?>
<?php endif; ?></td>
<?php $itemcounter++; ?>
<?php if ($itemcounter % 3 ==0) ?>

<?php if($this->totop): ?>

<?php endif; ?>
</tr></table>

<?php else: ?><?php echo $this->empty_list; ?><?php endif; ?><?php echo SimplelistsHelper::loadTemplate('_footer'); ?>

And here is the resulting html.


<!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-gb" lang="en-gb" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Jeremy Umbaugh, Honduras, missions, street kids, missionary, compassion, el sembrador, farm school, tegucigalpa, catacamas" />
<meta name="description" content="My personal website done in a Joomla environment." />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Staff</title>
<link rel="stylesheet" href="/joomla/components/com_simplelists/css/table.css" type="text/css" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<script type="text/javascript" src="/joomla/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/joomla/media/system/js/modal.js"></script>
<script type="text/javascript">

window.addEvent('domready', function() {

SqueezeBox.initialize({});

$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
</script>

<link rel="stylesheet" href="/joomla/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="/joomla/templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="/joomla/templates/copy/css/template.css" />
<!--[if IE 6]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/joomla/templates/copy/css/template.ie7.css" type="text/css" media="screen" /><![endif]-->
<script type="text/javascript" src="/joomla/templates/copy/script.js"></script>
</head>
<body>
<div id="art-page-background-gradient"></div>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu"><li class="item55"><a href="http://www.hondugringo.com/joomla/"><span class="l"> </span><span class="r"> </span><span class="t">Home</span></a></li><li class="item56"><a href="/joomla/index.php?option=com_content&amp;view=section&amp;layout=blog&amp;id=5&amp;Itemid=56"><span class="l"> </span><span class="r"> </span><span class="t">History</span></a></li><li class="item70"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=56&amp;Itemid=70"><span class="l"> </span><span class="r"> </span><span class="t">Students</span></a></li><li class="item57"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=36&amp;Itemid=57"><span class="l"> </span><span class="r"> </span><span class="t">Staff</span></a></li><li class="item64"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=41&amp;Itemid=64"><span class="l"> </span><span class="r"> </span><span class="t">Work Teams</span></a></li><li class="item62"><a href="/joomla/index.php?option=com_weblinks&amp;view=category&amp;id=38&amp;Itemid=62"><span class="l"> </span><span class="r"> </span><span class="t">Links</span></a></li><li class="item124"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=64&amp;Itemid=124"><span class="l"> </span><span class="r"> </span><span class="t">Photo Gallery</span></a></li><li class="item68"><a href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=43&amp;Itemid=68"><span class="l"> </span><span class="r"> </span><span class="t">Contact Us</span></a></li></ul></div>


<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name"><a href="/joomla/"></a></h1>
<div id="slogan-text" class="art-Logo-text"></div>
</div>


</div>

<div class="art-contentLayout">
<div class="art-content">

<div class="art-Post">
<div class="art-Post-body">
<div class="art-Post-inner">

<div class="art-PostContent">


<a name="top"></a>
<h1 class="componentheading">Staff</h1>


<div class="simplelists-category">
<span id="simplelists-description"></span>
</div>





<div class="simplelists-pagecounter">
</div>


<table>
<tr class ="simplelists-item">
<td width="180">

<img src="http://www.hondugringo.com/joomla//images/simplelists/Sandy Gabriela Velasquez C.jpg" alt="Sandy Gabriela Velasquez C" title="Sandy Gabriela Velasquez C" class="simplelists" width="108" height="144" />
<br>
<a name="sandy-gabriela-velasquez-c" id="sandy-gabriela-velasquez-c"></a>
<p style="text-align: left;"><strong>Sandy Gabriela Velásquez C.<br /></strong><em>Utilities Accountant</em></p> </td>


</tr></table>




<div class="simplelists-pagenavigation">
</div>


</div>
<div class="cleared"></div>


</div>

<div class="cleared"></div>
</div>
</div>



</div>
<div class="art-sidebar1"><div class="art-Block">
<div class="art-Block-tl"></div>
<div class="art-Block-tr"></div>
<div class="art-Block-bl"></div>
<div class="art-Block-br"></div>
<div class="art-Block-tc"></div>
<div class="art-Block-bc"></div>
<div class="art-Block-cl"></div>
<div class="art-Block-cr"></div>
<div class="art-Block-cc"></div>
<div class="art-Block-body">

<div class="art-BlockContent">
<div class="art-BlockContent-tl"></div>
<div class="art-BlockContent-tr"></div>
<div class="art-BlockContent-bl"></div>
<div class="art-BlockContent-br"></div>
<div class="art-BlockContent-tc"></div>
<div class="art-BlockContent-bc"></div>
<div class="art-BlockContent-cl"></div>
<div class="art-BlockContent-cr"></div>
<div class="art-BlockContent-cc"></div>
<div class="art-BlockContent-body">

<ul class="menu"><li id="current" class="active item122"><a href="/joomla/index.php?option=com_simplelists&amp;view=simplelist&amp;layout=table&amp;category_id=51&amp;Itemid=122"><span>Staff</span></a></li><li class="parent item60"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=62&amp;Itemid=60"><span>Missionaries</span></a></li><li class="parent item61"><a href="/joomla/index.php?option=com_content&amp;view=article&amp;id=63&amp;Itemid=61"><span>Volunteers</span></a></li></ul>
<div class="cleared"></div>
</div>
</div>


<div class="cleared"></div>
</div>
</div>

</div>

</div>
<div class="cleared"></div>


<div class="art-Footer">
<div class="art-Footer-inner">
<form action="index.php" method="post">
<div class="search">
<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Search" class="inputbox" type="text" size="20" value="search..." onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div>
<input type="hidden" name="task" value="search" />
<input type="hidden" name="option" value="com_search" />
</form> <div class="art-Footer-text">


Copyright &copy; 2010 Escuela El Sembrador


</div>
</div>
<div class="art-Footer-background"></div>
</div>
<div class="cleared"></div></div></div><div class="cleared"></div><p class="art-page-footer">
<a style="display:none" href="http://www.cmsplaza.com" title="CMS Plaza">Website CMS Joomla</a>
<p><a style="display:none" href="http://www.joomlapublisher.com" title="Joomla Publisher">Joomla Extensions Directory Listing</a></p></div>

</body>
</html>


And as you can see, I didn't get the correct result. It only shows 1 item in the first column. What did I do wrong?

tomws
03-12-2010, 09:27 PM
Only one of the lines is in the correct place. This is based on the original code. Try it:

<table class="<?php echo $this->page_class; ?>">
<?php $MY_ITEMS_PER_ROW = 3; ?>
<?php $MY_ITEM_COUNTER = 0; ?>
<?php foreach( $this->simplelist as $item ): ?>

<?php if($MY_ITEM_COUNTER % $MY_ITEMS_PER_ROW == 0): ?>
<tr class="simplelists-item">
<?php endif; ?>

<td valign="middle" align="center" class="simplelists-item-left">
<?php if($item->picture): ?>
<?php echo $item->picture; ?>
<?php endif; ?>

<br />

<a name="<?php echo $item->href; ?>"></a>

<?php if($item->title): ?>
<h3 class="contentheading"><?php echo $item->title; ?></h3>
<?php endif; ?>

<?php if($item->text): ?>
<?php echo $item->text; ?>
<?php endif; ?>

<?php if($item->readmore): ?>
<br/><?php echo $item->readmore; ?>
<?php endif; ?>

</td>
<?php $MY_ITEM_COUNTER++; ?>
<?php if($MY_ITEM_COUNTER % $MY_ITEMS_PER_ROW == 0): ?>
</tr>
<?php endif; ?>

<?php endforeach; ?>
</table>

KellyFaith
03-12-2010, 09:32 PM
Yes, this worked. You are my new hero. Thanks for putting up with me all day today!

Fou-Lu
03-12-2010, 09:40 PM
O.o
So... PHP issue then? Mkay. We gotta get rid of these breakouts; there are far more processing instructions than output in this:


<?php
echo '<table class="{$this->page_class}">';
$MY_ITEMS_PER_ROW = 3;
$MY_ITEM_COUNTER = 0;
foreach( $this->simplelist as $item ):
if($MY_ITEM_COUNTER % $MY_ITEMS_PER_ROW == 0):
echo '<tr class="simplelists-item">';
endif;
echo '<td valign="middle" align="center" class="simplelists-item-left">';
if($item->picture):
echo $item->picture;
endif;
echo '<br />
<a name="{$item->href}"></a>';
if($item->title):
echo '<h3 class="contentheading">{$item->title}</h3>';
endif;
if($item->text):
echo $item->text;
endif;
if($item->readmore):
echo '<br/>{$item->readmore}';
endif;
echo '</td>';
$MY_ITEM_COUNTER++;
if($MY_ITEM_COUNTER % $MY_ITEMS_PER_ROW == 0):
echo '</tr>';
endif;
endforeach;
echo '</table>';


Offhand, the above looks like it will work for setting up a three column table.


Snuck in there you did! Glad to hear it works now. Also, thought I'd mention that I don't particularily like the PHP alternate syntax. I loves my curly braces :D

tomws
03-12-2010, 09:43 PM
It's a Joomla template, I think. They're set up like that to make it easier for designers to see where the logic is and where the presentation is. Keeps them from getting confused. I added my modifications following the same format. Changing it to a more proper format will only confound designers looking at it later.

Fou-Lu
03-12-2010, 09:47 PM
Seriously? I've never heard of a situation where people prefer more opening/closing than less O.o
The alternative syntax then I can certainly see for keeping it standard across the board. Still doesn't mean that I like it >.<

tomws
03-12-2010, 09:51 PM
Really. Download and view a Joomla template or Drupal theme, or probably other large CMSs, too. Quite common. All in the name of separating logic and presentation while still staying in one template file.

DaiLaughing
03-12-2010, 10:46 PM
Anything to slow down the server I guess.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum