Forums / Templates, Stylesheets, Page Layout / Home Page Layout changes?

Home Page Layout changes?

Locked
Results 1 to 12 of 12
This thread is locked. New replies are disabled.
27 Feb 2008, 23:45
#1
genone avatar

genone

New Zenner

Join Date:
Dec 2007
Posts:
8
Plugin Contributions:
0

Home Page Layout changes?

Hi,

I am looking to change the order in which
define_main_page appears on the home page. I want Featured Products to display before define_main_page.

Is there an admin setting for this?

Thanks
27 Feb 2008, 23:49
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Posts:
4,572
Plugin Contributions:
0

Re: Home Page Layout changes?

Are you referring to the Sideboxes?

If yes, Sidebox order of Listing are controlled using:
Admin > Tools > Layout Boxes Controller

Order shown is controlled numerically; lower numbers show before higher numbers.. Doing some Trial & Error will allow you adjust the way you want. You can also use the FAQ link (top of every Forum page) to research further.
28 Feb 2008, 00:39
#3
genone avatar

genone

New Zenner

Join Date:
Dec 2007
Posts:
8
Plugin Contributions:
0

Re: Home Page Layout changes?

Hi Rob,

Thanks for the reply.

No. I have a single column layout. totally customized. I have already set all the sort orders for Feature, Specials and Expected Products. But I don't see an admin setting to position define_main_page.

Anyway, I've been searching but can't seem to come up with an answer. I looked at the PHP and I suppose I could change that. But I am just double checking for an admin override which would be easier to reset by someone else if needed.

Thanks




Website Rob:

Are you referring to the Sideboxes?

If yes, Sidebox order of Listing are controlled using:
Admin > Tools > Layout Boxes Controller

Order shown is controlled numerically; lower numbers show before higher numbers.. Doing some Trial & Error will allow you adjust the way you want. You can also use the FAQ link (top of every Forum page) to research further.
28 Feb 2008, 04:17
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Posts:
4,572
Plugin Contributions:
0

Re: Home Page Layout changes?

If you are using Sideboxes then you would have to use at least, a 2 column layout - yes?

The Layout Boxes Controller uses the same wording as the Sideboxes. So Sideboxes called 'information / more information' has your 'define_pages' links, on the Web pages and in the Layout Controller.

If I'm still missing your point then an image would be most helpful.
28 Feb 2008, 04:36
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Home Page Layout changes?

I am looking to change the order in which
define_main_page appears on the home page. I want Featured Products to display before define_main_page.

Is there an admin setting for this?

Not an admin setting but you can reorder the components in a copy of this file saved in your template structure:

/includes/templates/template_default/templates/tpl_index_default.php file
02 Mar 2008, 15:38
#6
genone avatar

genone

New Zenner

Join Date:
Dec 2007
Posts:
8
Plugin Contributions:
0

Re: Home Page Layout changes?

No, this is a single column page that I am developing. Left and right columns are turned off completely. Most of that I did via Admin. What I couldn't do via admin is make the featured products appear before the contents of define_main pages.

Sorry I don't have a url. But assuming it works well I will show it off once it's live.


Thanks!

Website Rob:

If you are using Sideboxes then you would have to use at least, a 2 column layout - yes?

The Layout Boxes Controller uses the same wording as the Sideboxes. So Sideboxes called 'information / more information' has your 'define_pages' links, on the Web pages and in the Layout Controller.

If I'm still missing your point then an image would be most helpful.
02 Mar 2008, 16:37
#7
genone avatar

genone

New Zenner

Join Date:
Dec 2007
Posts:
8
Plugin Contributions:
0

Re: Home Page Layout changes?

kobra:

Not an admin setting but you can reorder the components in a copy of this file saved in your template structure:

/includes/templates/template_default/templates/tpl_index_default.php file


Thanks.

That worked.

Maybe Zen Team might write in full sort order on all "boxes". A small improvement for those who aren't of" the programmers bent":D

Thanks all!
04 May 2008, 03:00
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Home Page Layout changes?

kobra:

Not an admin setting but you can reorder the components in a copy of this file saved in your template structure:

/includes/templates/template_default/templates/tpl_index_default.php file
So I tried this, and I am not getting the results I want.. I am about to pull my hair out.. Does anyone have any idea what I might have done wrong??
http://clients.overthehillweb.com/phlaunthair/phflauntshop/

I want the Main Page define to appear below the products on the main page..

?>
<div class="centerColumn" id="indexDefault">
<h1 id="indexDefaultHeading"><?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 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
  $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
  while (!$show_display_category->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 } ?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_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_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 } ?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_UPCOMING') { ?>
<?php
/**
 * display the Upcoming Products Center Box
 */
?>
<?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>


<?php
  $show_display_category->MoveNext();
} // !EOF
?>
</div>
05 May 2008, 11:58
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Home Page Layout changes?

Turns out that the file I needed to edit was: includes/templates/template_default/templates/tpl_index_categories.php file.. (You need to modify and place this file in your includes/templates/MY TEMPLATE/templates folder)

Now my main page define appears below the product categories on the main page..
12 May 2008, 10:38
#10
dbabbage avatar

dbabbage

New Zenner

Join Date:
Jul 2007
Posts:
30
Plugin Contributions:
0

Re: Home Page Layout changes?

I have the same query as the original post—I want to move my featured products above the main welcome text on the front page. However, when I edit my (overridden) copy of the tpl_index_default.php to re-order the content, the featured products simply disappear rather than appearing in the new location. Any suggestions? Edited tpl_index_default.php below. (Note I am using Zen Cart 1.3.7.1 and don't have any desire to upgrade if that can be at all avoided.)

[PHP]<?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 3464 2006-04-19 00:07:26Z ajeh $
*/
?>
<div class="centerColumn" id="indexDefault">
<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

<?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_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 (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_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 } ?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_UPCOMING') { ?>
<?php
/**
* display the Upcoming Products Center Box
*/
?>
<?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>


<?php
$show_display_category->MoveNext();
} // !EOF
?>
</div>[/PHP]
12 May 2008, 10:52
#11
dbabbage avatar

dbabbage

New Zenner

Join Date:
Jul 2007
Posts:
30
Plugin Contributions:
0

Re: Home Page Layout changes?

OK, I found out it worked if I removed the following line:
[PHP]<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') { ?>
[/PHP]
I also had to move it slightly up in the file to get the result I wanted, but that was obvious at that point.

So it seems to be working now. My main issue is that I don't like deleting code if I don't know what it is supposed to do! What does this line I deleted do normally?
12 May 2008, 10:54
#12
dbabbage avatar

dbabbage

New Zenner

Join Date:
Jul 2007
Posts:
30
Plugin Contributions:
0

Re: Home Page Layout changes?

Ah, I think I have it... It looks like this is the code which would also somehow display the featured products inside their own category listing areas? That doesn't seem to be happening any more. So is there a way I can have my cake and eat it too?