Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Move categories from the bottom center to top?

Move categories from the bottom center to top?

Locked

Views: 3,128

Results 1 to 20 of 25
This thread is locked. New replies are disabled.
1 Mar 2009, 8:37 AM
#1
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Move categories from the bottom center to top?

Hi,

my shop is

https://www.esseorganicskincare.nl/shop/

im trying to move the categories that are on the bottom to the top. but i cannot figure it out.
Have looked in dutch.php / index.php of the root / index.php of the tmpl folder / looked in css / looked in main_def

Please help! ;-)

going bananas!

tnx in advance.

1 Mar 2009, 8:54 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

The file to edit is /includes/templates/your_template/templates/tpl_index_categories.php.

1 Mar 2009, 10:06 AM
#3
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

Here is the file.

What do i change?

<?php /** * Page Template * * Loaded by main_page=index<br /> * Displays category/sub-category listing<br /> * Uses tpl_index_category_row.php to render individual items * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_index_categories.php 4678 2006-10-05 21:02:50Z ajeh $ */ ?> <div class="centerColumn" id="indexCategories"> <?php if ($show_welcome == true) { ?> <h1 id="indexCategoriesHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (SHOW_CUSTOMER_GREETING == 1) { ?> <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2> <?php } ?> <!-- deprecated - to use - uncomment <?php if (TEXT_MAIN) { ?> <div id="" class="content"><?php echo TEXT_MAIN; ?></div> <?php } ?>--> <!-- deprecated - to use - uncomment <?php if (TEXT_INFORMATION) { ?> <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div> <?php } ?>--> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <div id="indexCategoriesMainContent" class="content"><?php /** * require the html_define for the index/categories page */ include($define_page); ?></div> <?php } ?> <?php } else { ?> <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1> <?php } ?> <?php if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') { // categories_image if ($categories_image = zen_get_categories_image($current_category_id)) { ?> <div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div> <?php } } // categories_image ?> <?php // categories_description if ($current_categories_description != '') { ?> <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories --> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);

while (!$show_display_category->EOF) {
// // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);

?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_UPCOMING') { ?> <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> </div>
1 Mar 2009, 11:22 AM
#4
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

Sorry but i really need a hand on this.
I am trying everything with this but cannot seem to pull it off.

Anyone knows how to move the categories to the top of the main text in stead of bottom?

https://www.esseorganicskincare.nl/shop/

thanks again, really going nuts here.

1 Mar 2009, 3:19 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

Move this block of code:```php

<!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories -->

to just above this line:php

<?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
1 Mar 2009, 3:26 PM
#6
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

Dude, you are an absolute hero.

tnx a million. it worked.

The only issue i have now is that my menu disapeared on the next page.

https://www.esseorganicskincare.nl/shop/

any hints?

Alex

1 Mar 2009, 3:36 PM
#7
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

Dude, you are an absolute hero.

tnx a million. it worked.

The only issue i have now is that my menu disapeared on the next page. (if you click consumer

https://www.esseorganicskincare.nl/shop/

any hints?

Alex

1 Mar 2009, 3:52 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

I don't know what it looked like before, so not sure how it has changed. Should there be a product listing, or more subcategories?

1 Mar 2009, 4:00 PM
#9
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

I found it.

i copied the same chunk of code in the old spot AND above that line.

Now it works.
Dont know if that screws anything up but it works now.

:clap::clap::clap::clap::clap::clap::clap

Yes sub categories, but it shows them now.

Can i ask you one last question glenn?

If i open a product categorie, lets say, exfoliator, i see

Home :: Consument :: Exfoliators (breadcrumbs)

Exfoliators
Cocoa Exfoliator Microderm Exfoliator

I do not want product listing in navigationbar. How do i turn this off?

Tnx a million man, doing this whole thing alone with limited knowledge of php so means alot to me.

Alex

1 Mar 2009, 4:05 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

Adding the listing code twice will give you two listings on the home page.

I see the problem. The whole define page output is inside an if test block that only shows on the home page. It will be necessary to break up that if into two blocks so that the category listing will be unaffected. Your file should look like this now:```php

<?php if ($show_welcome == true) { ?> <h1 id="indexCategoriesHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (SHOW_CUSTOMER_GREETING == 1) { ?> <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2> <?php } ?> <!-- deprecated - to use - uncomment <?php if (TEXT_MAIN) { ?> <div id="" class="content"><?php echo TEXT_MAIN; ?></div> <?php } ?>--> <!-- deprecated - to use - uncomment <?php if (TEXT_INFORMATION) { ?> <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div> <?php } ?>--> <!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories --> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <div id="indexCategoriesMainContent" class="content"><?php /** * require the html_define for the index/categories page */ include($define_page); ?></div> <?php } ?> <?php } else { ?> <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1> <?php } ?> ```Change it to this:```php <?php if ($show_welcome == true) { ?> <h1 id="indexCategoriesHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (SHOW_CUSTOMER_GREETING == 1) { ?> <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2> <?php } ?> <!-- deprecated - to use - uncomment <?php if (TEXT_MAIN) { ?> <div id="" class="content"><?php echo TEXT_MAIN; ?></div> <?php } ?>--> <!-- deprecated - to use - uncomment <?php if (TEXT_INFORMATION) { ?> <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div> <?php } ?>--> <?php } //======close first test ?> <!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories --> <?php if ($show_welcome == true) { //======new test line ?> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <div id="indexCategoriesMainContent" class="content"><?php /** * require the html_define for the index/categories page */ include($define_page); ?></div> <?php } ?> <?php } else { ?> <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1> <?php } ?> ```
1 Mar 2009, 4:17 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

Configuration > Product Info > Previous Next - Navigation Includes Category Name and Image Status
gives these options:

Product's Category Image and Name Status
0= Category Name and Image always shows
1= Category Name only
2= Category Name and Image when not blank

which doesn't get rid of the category name. You can do it with CSS.
Add to your stylesheet:

h1#productListHeading {display: none;}

I see your home page only shows one set of categories - did you change it yet? I think the code I posted needs a tweak - back in a minute with more info.

1 Mar 2009, 4:29 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

Yes, the code I just posted would leave the category list above the category heading and description. You should leave the code as you had it, with the category list block in both places, and add a new if test around the second code block:```php

<?php // categories_description if ($current_categories_description != '') { ?> <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <?php if ($this_is_home_page == false) { //======new test line ?> <!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories --> <?php } //======new test line ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY); ```
1 Mar 2009, 4:31 PM
#13
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

i cut and paste your code in.
Seems to work just fine like this.
see any problems?

the only thing that i cannot get to work is that navigationbar thingy.
doesnt work with display: none;} in th stylesheet.

any hints? :flex::flex::flex::flex:

tnx alot mate, really apreciate this.
anything i can do you for, let me know.
(can send you some products if all worksout ;-)):clap::clap::clap:

1 Mar 2009, 4:53 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

It works when I test it on your stylesheet.
What exactly is it that you want to disappear? Just the category name heading, or the breadcrumbs, or both?

By the way, I notice that you have stylesheet_OLD.css. Do you think you have disabled it? It is still active, and can cause annoyances when it differs from stylesheet.css. Either delete it, move it somewhere else, or rename it stylesheet.bak. Anything with .css will be loaded and used.

1 Mar 2009, 4:56 PM
#15
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

Just out of curiosity, can you get to my files?

is the store safe?

Deleted it.

I want to keep the breadcumbs, that works great.
If i click a product category like exfoliator, i see the bar (under breadcrumbs) with the name again and the content written out.

Hate that, doesnt look nice.

any ideas?
:bigups::bigups::bigups::bigups:

1 Mar 2009, 6:03 PM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

I can't tell you how to fix the code I gave because it works as is to hide the category name heading. Are you sure you added it exactly as I posted? Do you also want to hide the

Cocoa Exfoliator Microderm Exfoliator

under Exfoliators? That is the category description, and you can just erase that text from the category if you don't want to show it.

Anyone browsing the web can look at the HTML source code of any page, and with common web developer tools installed, can look at the stylesheets that control it and make test-edits.

1 Mar 2009, 10:59 PM
#17
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

Yes, that is what i mean.

I dont understand this part

under Exfoliators? That is the category description, and you can just erase that text from the category if you don't want to show it.

If i erase the text, the products have no name?

Or is there a different place where i can erase the text?
Not in products, since that is the name of the product.

looking forward once again to your answer ;-)
:clap::clap::clap::clap::oops::oops::oops:
tnx

2 Mar 2009, 12:03 AM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

Catalog > Categories/Products > category listing > edit category Exfoliators > delete the category description, which is currently

Cocoa Exfoliator Microderm Exfoliator

This has nothing to do with the actual products' names.

2 Mar 2009, 1:27 AM
#19
beavertje avatar

beavertje

New Zenner

Join Date:
Mar 2009
Posts:
53
Plugin Contributions:
0

Re: Move categories from the bottom center to top?

YES SIR CAPTAIN KIRK SIR!

you are my hero.

I found it, gone it is!

Found a workaround to.

indexProductListCatDescription is the name in css, made it white.
But your way is nice and clean. Like that.

Ok amigo, your help made me jump alot today.
Dont know who you are but am happy to emburse you for your trouble. (productwise ;-))

I have one final question and that is the layout of consument.
You see that the categories are kind of a mess displayed now on this page......

http://www.esseorganicskincare.nl/shop/index.php?main_page=index&cPath=1

any tips on how to organise this nicer?

cant find the name for it yet, but am still searching.......
:frusty::frusty::frusty::frusty::clap::clap::

2 Mar 2009, 1:34 AM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Move categories from the bottom center to top?

Add to your stylesheet

.categoryListBoxContents {text-align: center;}

This is about the neatest it can get without significant code changes - each category is given an equal share of the column width, which doesn't work so well with only text of very different lengths. It looks best with pictures included for the categories.

P.S. - Search engines don't like the "white on white" text hiding trick - it can be used for spamming, so they penalize it.