osCmax v2.5 User Manual
Results 1 to 8 of 8

WYSIWYG Editor with New Static Pages

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 ...

      
  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default WYSIWYG Editor with New Static Pages

    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.

  2. #2
    New Member
    Join Date
    Sep 2005
    Posts
    13
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    Great stuff ! Thanks for sharing !

  3. #3
    Lurker
    Join Date
    Nov 2005
    Posts
    1
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    This is excellent, very easy to follow and works a treat. Thanks.

  4. #4
    New Member
    Join Date
    May 2006
    Posts
    14
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    thanks a million for this post..was next to impossible without it.

  5. #5
    New Member
    Join Date
    May 2006
    Posts
    5
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    yep, pat on the back jbanda, cheers.

  6. #6
    Member Cisco's Avatar
    Join Date
    Feb 2003
    Posts
    89
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    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. #7
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    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. #8
    Member Cisco's Avatar
    Join Date
    Feb 2003
    Posts
    89
    Rep Power
    0


    Default RE: WYSIWYG Editor with New Static Pages

    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.

Similar Threads

  1. Should I use CSS or WYSIWYG Editor?
    By alechhe in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 08-17-2006, 09:47 AM
  2. WYSIWYG editor for added pages in catalog section of admin
    By themainebaby in forum osCmax v2 Customization/Mods
    Replies: 6
    Last Post: 02-20-2006, 11:08 AM
  3. wysiwyg editor not showing
    By techmatters in forum osCMax v1.7 Installation
    Replies: 7
    Last Post: 03-15-2005, 05:49 PM
  4. WYSIWYG editor problem
    By laurens in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 12-08-2003, 06:49 PM
  5. WYSIWYG Editor 1.7
    By kamel in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 11-09-2003, 12:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •