You are here:  » Categories on main page/ customization

Support Forum



Categories on main page/ customization

Submitted by pat on Mon, 2007-05-14 22:47 in

Hello

I checked your example and doc before buying the script and I'd like to know if it is possible to display categories in columns on the main page (index page), also if it is possible to display custom text/images/links etc. on this same page.

In your example categories/ merchant /brands are displayed on the left with nothing else on the page, generally speaking can templates pages be easily customized with text, images or whatever that can be useful?

Is it possible to add custom text/links on the product page?

THanks

Pat

Submitted by support on Tue, 2007-05-15 08:46

Hi Pat,

Firstly, the merchant, category and brand lists can be displayed in multiple columns. In html/atoz.php you will see the following code on line 3:

$columns = 1;

Simply change this to the number of columns you would like displayed.

With regards to displaying categories on your index page; this can be achieved by copying the code from categories.php; excluding the first line ( the call to require() ) and down to the line just before the following code:

$banner["h2"] = "<strong>".translate("Category")." A-Z</strong>";

Paste the code into index.php, and then immediately below add the following:

require("html/atoz.php");

In general, you can customise the look and feel of your site simply by changing the files in the /html directory. Most files in that directory are plain HTML with PHP inline, so it should be straight forward to make any modifications you require. For example, to add custom links to the product page, you could modify html/product.php (which displays the main product info)...

Hope this helps!
Cheers,
David.

Submitted by pat on Tue, 2007-05-15 22:31

Hello

It works except the call to a category is like:

<a href="/category/Shoes/">Shoes</a>

when i add the code on the index page my link is

<a href="/Shoes/">Shoes</a>

then i end up with url not found.

I believe I have to do a modif to atoz.php, i duplicated this file, called it atoz_index.php for my index file and tried to modify:

    print "<a href=' " .$item["href"]." '>".$item["name"]."</a><br>";

but How do I add /category/ ? also I'd like to add the site url (that I have in a variable), so i'd like to get the right coding for something like:

 print "<a href= '<?=$url; ?>/category/+whatever comes here>".$item["name"]."</a><br>";

Thanks

Pat

Submitted by support on Wed, 2007-05-16 08:32

Hello Pat,

Sorry - yes when the code from categories.php is used on the index page you need to make a minor adjustment. Within the block of code you have copied into index.php you will find this code:

        if ($config_useRewrite)
        {
          $item["href"] = tapestry_hyphenate($product["category"])."/";
        }
        else
        {
          $item["href"] = "search.php?q=category:".urlencode($product["category"]).":";
        }

If you change this as follows:

        if ($config_useRewrite)
        {
          $item["href"] = $config_baseHREF."category/".tapestry_hyphenate($product["category"])."/";
        }
        else
        {
          $item["href"] = $config_baseHREF."search.php?q=category:".urlencode($product["category"]).":";
        }

That should do the trick...

Cheers,
David.