I've done several searches in this forum on how to add new static pages and be able to edit them with the FCKeditor (WYSIWYG) via the admin panel. After sorting through the bits and pieces, I've documented a way to do this. Here's how:
First, copy the shipping.php file in your main catalog directory, and rename it to testpage.php. (testpage.php is an example - you can choose a more suitable name for your new page if you prefer.)
In testpage.php, edit the following variables:
FILENAME_SHIPPING --Change to-- FILENAME_TESTPAGE
CONTENT_SHIPPING --Change to-- CONTENT_TESTPAGE
TEMPLATENAME_SHIPPING --Change to-- TEMPLATENAME_TESTPAGE
There are two instances of FILENAME_TESTPAGE, one instance of CONTENT_TESTPAGE and one instance of TEMPLATENAME_TESTPAGE that need to be changed in total. When you have changed all four definitions, save this file.
Now, if your template is "fallback" or based on the "fallback" directory, go into the "content" folder, copy the shipping.tpl.php and rename it testpage.tpl.php. (I haven't tried this with any template other than "fallback" yet.)
Change this line:
<td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIPPING_CONTENT); ?></td>
to this:
<td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TESTPAGE_CONTENT); ?></td>
Next, open includes/configure_bts.php and add:
define('TEMPLATENAME_TESTPAGE', 'testpage.tpl.php');
around line 17. Save this file.
Open filenames.php, which is in your catalog/includes directory, and create the following variable definitions:
define('CONTENT_TESTPAGE', 'testpage'); define('CONTENT_TESTPAGE_CONTENT', 'testpage_content');
and then:
define('FILENAME_TESTPAGE', CONTENT_TESTPAGE . '.php');
define('FILENAME_TESTPAGE_CONTENT', CONTENT_TESTPAGE_CONTENT . '.php');
Save this file.
Copy the file /catalog/includes/languages/english/shipping.php and rename it to testpage.php.
Edit the code shown in this example:
define('NAVBAR_TITLE', 'New Created Static Page');
define('HEADING_TITLE', 'New Created Static Page');
Don't bother modify the section:
define('TEXT_INFORMATION', 'This page tells you how to add a new static page to OSCMAX using the Template Structure.');
because it doesn't matter. Save the file.
Next, copy the file:
/catalog/includes/languages/english/shipping_content.php
and rename it to:
testpage_content.php.
Don't worry about changing the code in this page, because you'll be able to edit it with the WYSIWYG editor later on.
Now, for the backend.
Go to admin/index.php and find the section that says:
// Added line for Admin w/access levels
around line 27. Add a line to the bottom of the array so it looks like this:
array('title' => BOX_CATALOG_DEFINE_TESTPAGE, 'link' => tep_href_link(FILENAME_DEFINE_TESTPAGE, 'selected_box=catalog')),
)),
Next, open admin/includes/filename.php and around line 80 find the section that says:
// BOF: MOD - wysiwyg content & infobox pages
Add:
define('FILENAME_DEFINE_TESTPAGE', 'define_testpage.php');
Go to admin/includes/languages/english.php and around line 230 find the section that says:
// BOF: Added INFO Pages
and add:
define('BOX_CATALOG_DEFINE_TESTPAGE', 'Test Page');
Now, go to admin/includes/boxes/catalog.php. About line 45 you find:
// Added: info boxes
And change the last line from
tep_admin_files_boxes(FILENAME_DEFINE_SHIPPING, BOX_CATALOG_DEFINE_SHIPPING));
to
tep_admin_files_boxes(FILENAME_DEFINE_SHIPPING, BOX_CATALOG_DEFINE_SHIPPING) .
tep_admin_files_boxes(FILENAME_DEFINE_TESTPAGE, BOX_CATALOG_DEFINE_TESTPAGE));
Now, in the main admin directory, copy the define_shipping.php file and rename it to define_testpage.php. Open this file, and change every instance of "shipping" to "testpage" (about 10 in all).
Finally, give yourself permission to access the file in Administrator > File Access. Once you've done this, the link to the WYSIWYG editor for your new page will show up in the "catalog" info box and you'll be all set to go.





LinkBack URL
About LinkBacks






Bookmarks