Community Forums

creating a table on main page

Template support & advice for OpenCart v0.x

creating a table on main page

Postby dmbrownfield » Sat Feb 21, 2009 4:40 pm

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 ??
dmbrownfield
 
Posts: 89
Joined: Thu May 08, 2008 4:37 pm

Re: creating a table on main page

Postby Qphoria » Sat Feb 21, 2009 6:21 pm

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.
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: creating a table on main page

Postby naveed.ahmed » Wed Feb 25, 2009 5:25 am

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
naveed.ahmed
 
Posts: 8
Joined: Tue Feb 24, 2009 2:12 pm

Re: creating a table on main page

Postby nde » Wed Feb 25, 2009 8:29 pm

Yeah, the template files are the right place to put these things.
nde
 
Posts: 75
Joined: Fri Jun 29, 2007 11:32 pm

Re: creating a table on main page

Postby Qphoria » Wed Feb 25, 2009 9:10 pm

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
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria


Return to Template Support

Who is online

Users browsing this forum: No registered users and 2 guests

Hosted by Arvixe Web Hosting