Hi Dave,
I have managed to create a logo based merchant A to Z but I am having problem with spacing them out evenly on my page. I need your help.
I considering using a tables and showing 4 Logos across, but I can't seem to work it around. Can you modify the original merchant.php in the "/html/" folder to show four merchant across and as many as needed down, using the table. Yu modify the text version then I will cange the LOGO version acordingly.
Thank You Boss!
Noor
Thanks Dave, but I think I did not explained it very well. What I am trying to do is each of the "first letter" is to become the single column going edge to edge and beheath each letter I want show mercang names that starts with the letter in the header column. For example:
<<HEADER LETTER A>>
<<MER 1A>> <<MER 2A>> <<MER 3A>> <<MER 4A>>
<<HEADER LETTER B>>
<<MER 1A>> <<MER 2A>> <<MER 3A>>
so on ...
Hi,
I understand - here's an alternative version of atoz.php (you could call it merchantatoz.php as described above) which should do what you want...
<div class='atoz'>
<?php
$columns = 4;
$columnWidth = intval(100/$columns);
$currentLetter = "";
$currentColumn = 0;
foreach($atoz["items"] as $item)
{
$firstLetter = strtoupper(substr($item["name"],0,1));
if ($firstLetter <> $currentLetter)
{
if ($currentLetter)
{
print "</tr>";
print "</table>";
}
print "<h4>".$firstLetter."</h4>";
print "<table width='100%'>";
print "<tr>";
$currentLetter = $firstLetter;
$currentColumn = 0;
}
$currentColumn++;
print "<td valign='top' width='".$columnWidth."%'>";
print "<p><a href='".$item["href"]."'>".$item["name"]."</a></p>";
print "</td>";
if ($currentColumn == $columns)
{
print "</tr>";
print "<tr>";
$currentColumn = 0;
}
}
print "</tr>";
print "</table>";
?>
</div>
Cheers,
David.
I think I am love with your script :-)
Thanks for that.
Hello Noor,
The Merchant index uses the html/atoz.html HTML module; which already has a mechanism to show multiple columns. However, if you only want 4 columns for your merchant index, leaving the category and brand index as they are, the easiest thing to do is to make a copy of html/atoz.html and call it something like html/merchantatoz.php.
Then, in the new file, change line 3 as follows:
$columns = 4;
...and finally, back in merchants.php, change line 39 from:
require("html/atoz.php");
to:
require("html/merchantatoz.php");
Cheers,
David.