Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Basic Configuration / Moving "New Products" center box higher on home page

Moving "New Products" center box higher on home page

Locked

Started by cpj on 15 Jul 2008, 5:59 AM · Views: 3,394

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
15 Jul 2008, 5:59 AM
#1
cpj avatar

cpj

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Post #1 by cpj

https://www.200westmain.com/citypretties

I would like to move the New Products center box up higher on my page. In other words, I'd like to set it between the text I have there - about smack in the middle.

Is there a simple way to do this?

Thanks!

15 Jul 2008, 7:26 AM
#2
kobra avatar

kobra

Black Belt

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

Post #2 by kobra

Look at your admin > tools > define pages editor > main_page.php and remove any space at the bottom of this content

Zen-Venom Get Bitten

15 Jul 2008, 5:03 PM
#3
cpj avatar

cpj

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Post #3 by cpj

kobra:

Look at your admin > tools > define pages editor > main_page.php and remove any space at the bottom of this content

Hello Kobra,

Thank you. I have done this and it removes the space between the bottom of the text and the centerbox. But what I'd like to do is set the centerbox midway on the page, between lines of text, right above where it says "Custom orders are always welcome!"

Is it possible to do this?

Thank you again,
CPJ

15 Jul 2008, 10:58 PM
#4
kobra avatar

kobra

Black Belt

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

Post #4 by kobra

Not above as this is only what is contained in the main_page.php file

If you want the text "Custom orders are always welcome!" to be after the new listings you would remove fron the define main_page.php file and can add it in a div in your copy of common/tpl_main_page.php file

Zen-Venom Get Bitten

16 Jul 2008, 12:41 AM
#5
cpj avatar

cpj

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Post #5 by cpj

kobra:

Not above as this is only what is contained in the main_page.php file

If you want the text "Custom orders are always welcome!" to be after the new listings you would remove fron the define main_page.php file and can add it in a div in your copy of common/tpl_main_page.php file

Okay. I just wanted it higher on the page, but I guess I'm just too verbose. Thanks for your help.

CPJ

29 Aug 2008, 12:50 PM
#6
procella avatar

procella

New Zenner

Join Date:
Aug 2008
Posts:
97
Plugin Contributions:
0

Post #6 by procella

CPJ:

Okay. I just wanted it higher on the page, but I guess I'm just too verbose. Thanks for your help.

CPJ

edit your stylesheet.css

find ** .centerBoxWrapper **

and add the line margin-top:-300px;

before }

with this it will move 300px up (the minus)

che tutorial how to save stylesheets

29 Aug 2008, 5:02 PM
#7
cpj avatar

cpj

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Post #7 by cpj

procella:

edit your stylesheet.css

find ** .centerBoxWrapper **

and add the line margin-top:-300px;

before }

with this it will move 300px up (the minus)

che tutorial how to save stylesheets

Thank you, Procella. I have done that and it works, but now my afore-mentioned verbosity is on top of the centerbox. How do I correct this? See it here:

http://200westmain.com/citypretties/

Thanks,
Becky

29 Aug 2008, 5:50 PM
#8
cpj avatar

cpj

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Post #8 by cpj

I've returned my stylesheet to its previous incarnation, but the text was imposed on top of the centerbox images. Is there a way around this?

6 Jan 2009, 2:19 PM
#9
games4gamers avatar

games4gamers

New Zenner

Join Date:
Dec 2008
Posts:
55
Plugin Contributions:
0

Post #9 by games4gamers

I'd also like to know how to do this...

6 Jan 2009, 2:43 PM
#10
games4gamers avatar

games4gamers

New Zenner

Join Date:
Dec 2008
Posts:
55
Plugin Contributions:
0

Post #10 by games4gamers

I found the answer in a similar thread: https://www.zen-cart.com/forum/showthread.php?t=82643

What you need to do is:

  • Go to your zencart\includes\templates\custom\templates folder (in my case custom is replaced by cherry_zen, yours may be different.

  • Open the file tpl_index_default.php in your favorite text editor (I personally use Notepad ++).

  • Make sure you make a backup of this file prior to doing any editing (you can do this by copying it into the same folder).

  • Whatever boxes you would like to move, copy and paste to the top of the page, like so:

Let's say we want to move "New Products" above our main text content.

Look for something like this:

<?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 } ?>

<!-- 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
 */
?>

Right above where it says DEFINE_MAIN_PAGE_STATUS, paste in your boxes you want displayed above your content, in this case the "New Products" box:

<?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'); ?>

Upload to the correct folder on your server and voila! You now have your boxes above your text content.