This is a discussion on WYSIWYG Editor with New Static Pages within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; I've done several searches in this forum on how to add new static pages and be able to edit them ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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. |
| The Following 2 Users Say Thank You to jbanda For This Useful Post: | ||
altenter (08-01-2007), nicholasbw (03-05-2007) | ||
|
#2
| |||
| |||
| Great stuff ! Thanks for sharing ! |
|
#3
| |||
| |||
| This is excellent, very easy to follow and works a treat. Thanks. |
|
#4
| |||
| |||
| thanks a million for this post..was next to impossible without it. |
|
#5
| |||
| |||
| yep, pat on the back jbanda, cheers. |
|
#6
| ||||
| ||||
| This is good information. It help very much. What I am having trouble is getting the testpage to link to the left column information box. |
|
#7
| |||
| |||
| Cisco, these instructions were written with the assumption that the reader already knew how to link to the page being created. To learn how to create a new infobox (or get an idea how to add a new link to the existing information infobox) see this set of instructions. |
|
#8
| ||||
| ||||
| I have been using OSC since about 98, I am a ferm believer in the project. The reason I switched to oscMax is that there are a lot of different functions that I liked about the new set-up. I am not a programmer but I can follow the code. Every once in a while I have problem that I am not able to find. One of the things that I had seen in the oscommerce site and forum is the repetitive items and in the forum. The one thing that makes this seem so hard is that the search functions for finding what you need is almost useless. Thinking that one already knows what to do most instructions are left incomplete, there are a lot of new people that are not programmers or understand the concept but they do try. |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Should I use CSS or WYSIWYG Editor? | alechhe | osCMax v2 Installation issues | 1 | 08-17-2006 09:47 AM |
| WYSIWYG editor for added pages in catalog section of admin | themainebaby | osCMax v2 Customization/Mods | 6 | 02-20-2006 12:08 PM |
| wysiwyg editor not showing | techmatters | osCMax v1.7 Installation | 7 | 03-15-2005 06:49 PM |
| WYSIWYG editor problem | laurens | osCommerce 2.2 Modification Help | 2 | 12-08-2003 07:49 PM |
| WYSIWYG Editor 1.7 | kamel | osCMax v1.7 General Mods Discussion | 2 | 11-09-2003 01:19 PM |