Adding content to main page above and below "Featured" products???
I would like to (possibly) include custom content on my main page both above (which I have done) and BELOW the Featured Products that display in the main page, center area. Is this possible? and if so, how?
/includes/modules/featured_products.php???
Basically,
HOME PAGE
Menu Main Page (define) Content
Featured Products here in 1 row
MORE custom content
THANKS!
Re: Adding content to main page above and below "Featured" products???
Ok, I got adventurous and edited
templates/mytemplate/common/tpl_main_page.php
And managed to get additional content to show below the featured box just like I wanted it to ... BUT ...
now it shows on EVERY page below everything.
Is there a way to get it to JUST appear on the main page?
(link)
Re: Adding content to main page above and below "Featured" products???
You need to put some restriction on where the additional content must appear.
Look here for some ideas:
http://www.zen-cart.com/forum/showthread.php?t=55487
Re: Adding content to main page above and below "Featured" products???
Awesome! I just tried this:
<!--additional content below featured products-->
<?php if ($this_is_home_page)
{ ?>
INSERT HTML HERE
<?php } ?>
<!-- eof additional content below featured -->
THANK YOU!
Re: Adding content to main page above and below "Featured" products???
I've been experimenting for half an hour and can't figure out where exactly to put your code without messing up other parts of the page. A little more info, please, for us non-programmers!
R
Re: Adding content to main page above and below "Featured" products???
As is often the case, I experimented a little more and figured it out right after the 7-minute limit to edit or cancel my previous post.
It goes at line 132 (of tpl_main_page.php):
PHP Code:
.... * prepares and displays center column
*
*/
require($body_code); ?>
<!--additional content below featured products-->
<?php if ($this_is_home_page)
{ ?>
YOUR TEXT OR CODE
<?php } ?>
<!-- eof additional content below featured -->
<?php
if (SHOW_BANNERS_GROUP_SET4 != ......
Thanks!
R
Re: Adding content to main page above and below "Featured" products???
Will this work even if the featured products is not currently displayed?
Re: Adding content to main page above and below "Featured" products???
This is exactly almost what I want !
I have a bilingual website, how could I add a user defined box here, instead of just having content ? I can set up the box, I just don't know how to call it.
Thank you !
Re: Adding content to main page above and below "Featured" products???
Please, could someone help me out with this ?
Thanks in advance :smile:
Re: Adding content to main page above and below "Featured" products???
I have been testing with a few options here, and since I know almost nothing about php, I am kinda stuck here... :blink:
I tried adding the define_page_2.php in my tpl_index_default.php file, but all I kkeep getting is a copy of the define_main_page.php content... Here is the code:
Code:
<?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
*/
?>
<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
*/
?>
<?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
?>
<?php if (DEFINE_PAGE_2_STATUS >= 2 and DEFINE_PAGE_2_STATUS <= 3) { ?>
<?php
/**
* get the Define Main Page Text
*/
?>
<div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
<?php } ?>
</div>
I'm sure the problem lies in the require($define_page), but I have no clue how to fix this !
Could someone please point me in the right direction ?:frusty:
Thank you !