Hi,
I've added posts to several different threads on this issue, but I haven't had a reply as yet, so I thought I'd start a new thread & see if it helped.
I want to add a few new pages in the More_information sidebox, so I cloned Page_2 in every place I could find it using Developers Tool Box & 2 that I didn't.
I originally copied Kobra's post from about 2005, but I've added to it.
I will past it below, with all the changes I've made listed with the places where they were put.
Creating new pages in Zen Cart, AD 2005
For illustration use the page_2 as a guide
Try starting over and in these areas edit or create what is required changing only the reference to page_2 to
page_5...get it to work in that default generic form before you begin changing things like "Zimbabwe Orphans Endeavor'"
Just the straight page_5 references to start.
Create/clone these as page_5
/admin/includes/languages/english.php ( one line: define('BOX_TOOLS_DEFINE_PAGE_5','Page 5'); )
/admin/includes/languages/english/define_page_editor.php ( one line: define('TEXT_INFO_PAGE_5', 'Page 5'); )
/includes/modules/pages/page_2/header_php.php ( cloned folder, changed folder name & edited
heager_php.php as follows: <?php
/**
* Page 5
*
* @package page
* @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: header_php.php 3230 2006-03-20 23:21:29Z drbyte $
*/
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/',
FILENAME_DEFINE_PAGE_5, 'false');
?>
/includes/languages/english/page_2.php (cloned & edited as follows:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | [email protected] so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: page_5.php 1969 2005-09-13 06:57:21Z drbyte $
//
define('NAVBAR_TITLE', 'Directories');
define('HEADING_TITLE', 'Search Engine Directories');
define('TEXT_INFORMATION', 'A list of directories that you might find helpful');
?>
/includes/templates/template_default/templates/tpl_page_2_default.php ( cloned & edited as follows:
<?php
/**
* tpl_page_5_default.php
*
* @package templateSystem
* @copyright Copyright 2003-2005 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_page_5_default.php 3464 2006-04-19 00:07:26Z ajeh $
*/
?>
<div class="centerColumn" id="pageFive">
<h1 id="pageFiveHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if (DEFINE_PAGE_5_STATUS >= 1 and DEFINE_PAGE_5_STATUS <= 2) { ?>
<div id="pageFiveMainContent" class="content">
<?php
/**
* require the html_define for the page_5 page
*/
require($define_page);
?>
</div>
<?php } ?>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>';
?></div>
</div>
Add/edit these to include page_5
/includes/modules/sideboxes/more_information.php ( entry for Page_2 cloned & edited to read:
if (DEFINE_PAGE_5_STATUS <= 1) {
$more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_5) . '">' . BOX_INFORMATION_PAGE_5 . '</a>';
}
/includes/languages/english.php ( this added: define('BOX_INFORMATION_PAGE_5', 'Directories'); )
/includes/filenames.php ( 2 statements added, first: define('FILENAME_DEFINE_PAGE_5',
'define_page_5'); then: define('FILENAME_PAGE_5', 'page_5'); )
/includes/templates/template_default/templates/tpl_site_map_default.php ( statement added:
<?php if (DEFINE_PAGE_5_STATUS <= 1) { ?>
<li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_5) . '">' . BOX_INFORMATION_PAGE_5 . '</a>'; ?
></li>
<?php } ?> )
Create define_page_5.php in both of these folders
/includes/languages/english/html_includes ( added a define_page_5.php file )
/includes/languages/english/html_includes/your_template ( added a define_page_5.php file )
This should net you a generic page_5 in the "More Information" sidebox
You can then begin using this in your overrides areas
Once this works you can move on to custom titles etc - one at a time so you can track back if it breaks
As you can see, it still has the text that Kobra had inserted for instructions on how to clone a Page_2.
I am using V1.3.02 at the moment.
The page appears everywhere, except in Config Define Page Status.
I did do a search on my database to see if there was Page_5 info in there: what I actually did was click search then in the box I put Page_5, selected exact phrase then clicked go - nothing
I did the same for Page 5 & page 5, PAGE 5 & PAGE_5.
No results for any of those searches, but I don't really know if I was searching correctly.
If there is nothing in the database, why not?
I cloned & added text in every place I could find & would have thought that Zen Cart would have inserted the proper instructions in the database.
Can anyone help please?
Thanks in advance
######
http://www.artyfactsforcrafts.com
Bookmarks