Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Display Categories On Main Page

Display Categories On Main Page

Locked

Views: 2,109

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
20 Nov 2006, 8:30 AM
#1
amirey avatar

amirey

New Zenner

Join Date:
Mar 2006
Posts:
34
Plugin Contributions:
0

Display Categories On Main Page

I'm displaying the categories on the index page
"Categories - Always Show on Main Page - 1"

I also have some text I want to put in the main page (some welcome info that's also good for SEO). The problem is that whatever I put in the "define_main_page.php", which gets displayed on the main page, appears before the categories, gently pushing down the categories with the fancy photos out of site.

Is there any way to make the categories appear first on the index page, and have the text in "define_main_page.php" below it?

20 Nov 2006, 9:46 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Display Categories On Main Page

amirey:

I'm displaying the categories on the index page
"Categories - Always Show on Main Page - 1"

I also have some text I want to put in the main page (some welcome info that's also good for SEO). The problem is that whatever I put in the "define_main_page.php", which gets displayed on the main page, appears before the categories, gently pushing down the categories with the fancy photos out of site.

Is there any way to make the categories appear first on the index page, and have the text in "define_main_page.php" below it?You would need to edit the includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php file to reverse the order in which they are output.

20 Nov 2006, 11:48 AM
#3
amirey avatar

amirey

New Zenner

Join Date:
Mar 2006
Posts:
34
Plugin Contributions:
0

Re: Display Categories On Main Page

I copied includes/templates/default_template/templates/tpl_index_default.php into includes/templates/YOUR_TEMPLATE/templates/, and changed the order of things so the end of the file is:


<?php $show_display_category->MoveNext(); } // !EOF ?> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <?php /** * get the Define Main Page Text */ ?> <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div> <?php } ?> </div> ---------

It would still show the text first and the categories pictures second. There must be something I don't understand.

20 Nov 2006, 12:20 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Display Categories On Main Page

Your change looks fine to me, so this is mostly likely an issue with the amended file being recognised. Have you inserted your template directory name where I wrote YOUR_TEMPLATE? If so, check that it has been spelt correctly.

20 Nov 2006, 12:27 PM
#5
amirey avatar

amirey

New Zenner

Join Date:
Mar 2006
Posts:
34
Plugin Contributions:
0

Re: Display Categories On Main Page

Hi Kuroi

Thanks for the help. I think I did not explain myself fully, and therefore got a wrong answer. However, you did give me the direction to look in.

I was switching the 'display categories on main page' option in the admin on, and wanted the categories to be displayed on top of the text in the define page.

For all the other options (fetured products etc.), the "tpl_index_default.php' would be the one to change, but switching that option on makes zen cart ignore that file, and go for the 'tpl_index_categories.php' instead. So I had to change that file, and it worked. Everything else was the way you said.

Thanks again,
Cheers,
Alex