Page 1 of 1

creating a table on main page

Posted: Sun Feb 22, 2009 12:40 am
by dmbrownfield
I tried creating a 2 column table in this file:
store/catalog/language/english/controller/home.php

but after inserting the HTML code and refreshing the page, all of my text on that page is gone. The headings and categories, etc are there but no text.

Help ??

Re: creating a table on main page

Posted: Sun Feb 22, 2009 2:21 am
by Qphoria
usually means you broke something on that page and the php error is supressed. Try starting over.. using small steps and checking the page after each change.

Re: creating a table on main page

Posted: Wed Feb 25, 2009 1:25 pm
by naveed.ahmed
Dear you can make a table on the main page using following hierarchy

catalog-> view->template>common->home.tpl

for example: i have made a table on content area above products int he main page

<div class="top">

<h1><?php echo "Welcome to Cellswoop Shopping Cart"; ?></h1>

</div>

<div class="middle">

<!-- <div>

<p><?php echo $welcome; ?></p>

</div>
-->
<!-- <div class="heading"><?php echo $text_latest; ?></div>-->
<table width="550px" border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="125px" valign="top" align="left">some text here</td>
<td width="125px" valign="top" align="left">some text here</td>
<td width="125px" valign="top" align="left">some text here</td>
<td width="125px" valign="top" align="left">some text here</td>
</tr>
</table>




<table class="list">

<?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>

<tr>

<?php for ($j = $i; $j < ($i + 4); $j++) { ?>

<td width="25%"><?php if (isset($products[$j])) { ?>

<a href="<?php echo $products[$j]['href']; ?>"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a><br />

<a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br />

<span style="color: #999; font-size: 11px;"><?php echo $products[$j]['model']; ?></span><br />

<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />

<?php if ($products[$i]['rating']) { ?>

<img src="catalog/view/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" />

<?php } ?>

<?php } ?></td>

<?php } ?>

</tr>

<?php } ?>

</table>

</div>

<div class="bottom"></div>

i hope you will get it

Re: creating a table on main page

Posted: Thu Feb 26, 2009 4:29 am
by nde
Yeah, the template files are the right place to put these things.

Re: creating a table on main page

Posted: Thu Feb 26, 2009 5:10 am
by Qphoria
The main page has it's own editor in the admin now. Why not just create the table there? No need to edit tpl file