Zen Cart Logo

Index Page Issue

Locked

Views: 2,083

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
5 Sep 2007, 5:28 PM
#1
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Index Page Issue

Ok, I've got my columns switched around. Now where you see the product listings, I am trying to add some content above that. Is that in Define Pages Editor? If not how do I achieve this?

www.tomsts.com

Thanks

5 Sep 2007, 5:47 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Index Page Issue

For the home page, you would edit define_main_page.php in the Define Pages Editor.

For category-specific content in that position, you would edit the category in Catalog > Categories/Products and add text or any HTML content.

6 Sep 2007, 4:36 AM
#3
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Index Page Issue

I edited that file but it wouldn't show up. I have my define page status showing it there. Is there a reason that wouldn't shot up?

6 Sep 2007, 5:53 AM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Index Page Issue

Was there some boilerplate text there when you first installed your template? Template Monster is known for disabling standard Zen Cart functions that they don't think they want for a template layout.

If Define Main Page Status in Configuration > Define Pages Status is 1 or 2, and you are not seeing <div id="indexCategoriesMainContent"... in view source, then you should ask TM to fix what they have broken. That div should be there even if the define file is blank or missing.

The file that takes care of this is /includes/templates/your_template/templates/tpl_index_categories.php.

7 Sep 2007, 4:24 AM
#5
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Index Page Issue

gjh42:

Was there some boilerplate text there when you first installed your template? Template Monster is known for disabling standard Zen Cart functions that they don't think they want for a template layout.

If Define Main Page Status in Configuration > Define Pages Status is 1 or 2, and you are not seeing <div id="indexCategoriesMainContent"... in view source, then you should ask TM to fix what they have broken. That div should be there even if the define file is blank or missing.

The file that takes care of this is /includes/templates/your_template/templates/tpl_index_categories.php.

Here is what my "tpl_index_categories.php" looks like

<?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 3256 2006-03-25 19:08:47Z ajeh $ */ ?> <div id="indexCategories"> <?php if ($show_welcome == true) { ?> <?=tm_head(HEADING_TITLE)?> <div class="main_block"> <?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 // 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 /** * 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> <?=tm_head_end()?> </div>

It shows that id in there.

7 Sep 2007, 7:41 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Index Page Issue

Looks like this is not the file in use. With your one-level category tree, your setup will only ever use this file if you have
Configuration > Layout Settings > Categories show on main page = true
and Main page opens with category = 0 (for "all categories").

tpl_index_default.php is the file used on your home page.

If you want to post it to look at, please put it between ```
[php] and [/php]

10 Sep 2007, 3:55 PM
#7
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Index Page Issue

Ok, I've got it to load, however, I've got the 'Congratulations' reference that I obviously don't want, and I don't want to see the categories listed.

How can I remove those?

10 Sep 2007, 5:06 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Index Page Issue

For the "Congratulations...", see this FAQ.

Set the categories display in Configuration > Layout Settings > Categories - Always Show on Main Page, and related lines if desired.

11 Sep 2007, 6:06 AM
#9
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Index Page Issue

Problem is. I need to have 'show main categories..." on in order for my define pages main info to show up. However, I can't seem to get the category links that are showing up below to go away in the layout settings.

It also makes my "new products" show up and my "featured products" dissapear.

I just want my featured products and the main page info to post.

11 Sep 2007, 6:29 AM
#10
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Index Page Issue

Here is the tpl_index_default file

<?php
/**
 * Page Template
 *
 * Main index page<br />
 * Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br />
 * Centerboxes are called as necessary
 *
 * @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_default.php 3254 2006-03-25 17:34:04Z ajeh $
 */
?>
<div id="indexDefault" class="rbg1">
<?php if (SHOW_CUSTOMER_GREETING == '1') { ?>
<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>
<!-- deprecated - to use uncomment this section
<?php if (TEXT_MAIN) { ?>
<div id="" class="content"><?php echo TEXT_MAIN; ?></div>
<?php } ?>
 deprecated - to use uncomment this section
<?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') { ?>
<?php
/**
 * get the Define Main Page Text
 */
?>
<div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
<?php } ?>
-->
<?php
  $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
  while (!$show_display_category->EOF) {
?>
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') { ?>
<?php
/**
 * display the Featured Products Center Box
 */
?>         
<?=tm_head('Featured products:');?>          
<?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_MAIN_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_MAIN_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 } 
 if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_UPCOMING') { ?>
<?php
/**
 * display the Upcoming Products Center Box
 */
  include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS));  
  } 
  $show_display_category->MoveNext();
} // !EOF
?>
</div>
11 Sep 2007, 1:24 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Index Page Issue

That's the right file! The TM designer has commented out the define_main_page content so it will never display:```php

<?php } ?>--> <!-- <?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 } ?> --> <?php ``` Remove the HTML comment tags <!-- --> to get this: ```php <?php } ?>--> <?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 } ?> <?php ```Then, as long as define_main_page is enabled in Configuration > Define Pages, it will work right.

There is no reason in this code why you would be getting the new and not the featured products. Have you double-checked the settings in Configuration > Index Pages?

12 Sep 2007, 5:01 PM
#12
ryanwithanr avatar

ryanwithanr

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Index Page Issue

Ok, it worked!! Is there any reason now that I have this image in there that when I try to align left it distorts and rearranges the "feature items" content below it? I want my image to take up the entire width of that colum. But when I try to align it to tweaks everything.

12 Sep 2007, 5:42 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Index Page Issue

I'm sure there's a reason ;)
Somewhere in TM's coding or stylesheet settings... I couldn't tell you where without probably diving deep into it.

17 Sep 2007, 12:32 AM
#14
flashback avatar

flashback

New Zenner

Join Date:
Sep 2007
Posts:
41
Plugin Contributions:
0

Re: Index Page Issue

Lol I found it at the same time, thank you very much, it is exactly the same problem of that thread :)

Thanks:clap: