Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I include a page in a sidebox?

    To add a page such as the define page for shipping_info to a sidebox like:
    /includes/modules/sideboxes/more_information.php

    copy to your templates and overrides directory:
    /includes/modules/sideboxes/your_template_dir/more_information.php

    You can use:
    PHP Code:
        $add_a_page zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'FILENAME_DEFINE_SHIPPINGINFO'false');
        
    $more_information[] = require($define_page); 
    To add to a tpl_something.php you would use:
    PHP Code:
        $add_a_page zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'FILENAME_DEFINE_SHIPPINGINFO'false');
      
    $content .= require($add_a_page); 
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #12
    Join Date
    Jun 2006
    Posts
    86
    Plugin Contributions
    0

    Default Re: How can I include a page in a sidebox?

    Ajeh I really appreciate the help you attempt. However you are presenting it as if to a fellow programmer at your level and I am not even a beggining programmer.

    All that you have posted really is not logical to me so I don't know how to apply it. If you could just present the fix for the file structure that I have created all will be solved. Please just look over the codes I have below and add the correct codes in the exact way to make this work.

    I am not using the override, just changing the files of the default.

    Files created:
    1. The file that collects the info from the text editor in admin - Working perfect. It shows up in the list of the Define Pages Editor and I can write to it using the text editor
    includes/languages/english/html_includes/define_textbox.php

    2. The file that displays the sidebox choice in the Layout Boxes Controller in admin - Working perfectly. I see it in the list of define pages and can choose it and displays on the site pages correctly
    includes/modules/sideboxes/textbox.php
    <?php
    /**
    * new side box
    *
    * @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: search.php 2834 2006-01-11 22:16:37Z birdbrain $
    */

    require($template->get_template_dir('tpl_textbox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_textbox.php');

    $title = '<label>' . BOX_HEADING_STUFF . '</label>';
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    ?>
    3. The file that is to call the content from define_tecxtbox.php - Not working.
    includes/templates/template_default/sideboxes/tpl_textbox.php
    <?php
    /**
    * Side Box Template
    *
    * @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_search.php 4142 2006-08-15 04:32:54Z drbyte $
    */
    $content = "";
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    $add_a_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_TEXTBOX, 'false');
    $content .= 'This is where I want the include page. If I write the content here like this red text sentence then it appears on the site pages without error but I'd rather have the include page.';
    $content .= '</div>';
    ?>

  3. #13
    Join Date
    Jun 2006
    Posts
    86
    Plugin Contributions
    0

    Default Re: How can I include a page in a sidebox?

    Many others will benefit from this if it is ever figured

  4. #14
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I include a page in a sidebox?

    Where is this defined?
    FILENAME_DEFINE_TEXTBOX

    What do you have it set to?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #15
    Join Date
    Jun 2006
    Posts
    86
    Plugin Contributions
    0

    Default Re: How can I include a page in a sidebox?

    I created a header_php.php in includes/modules/pages/textbox/

    <?php
    /**
    * Page 2
    *
    * @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
    $add_a_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_TEXTBOX, 'false');
    $more_information[] = require($define_page);

    ?>
    based on my interpretation of previous instructions

  6. #16
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I include a page in a sidebox?

    This constant itself needs to be defined:
    FILENAME_DEFINE_TEXTBOX

    You have to have somewhere a define statement that says what that constant means ...

    Example, page 2 is setup as:
    PHP Code:
    define('FILENAME_DEFINE_PAGE_2''define_page_2'); 
    You need to have your constant setup as well ...

    This can be done in your own file in the:
    /includes/extra_datafiles

    Create your own file such as:
    /includes/extra_datafiles/my_defines.php

    PHP Code:
    <?php
    define
    ('FILENAME_DEFINE_TEXTBOX''define_textbox.php');
    ?>
    This is an autoloading directory ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #17
    Join Date
    Jun 2005
    Posts
    120
    Plugin Contributions
    0

    Default Re: How can I include a page in a sidebox?

    hi, i am also trying to do this. i almost have it, but for the life of me cannot figure out why it is doing the following: placing the text from the define page (define_page_5) outside the template for the sidebox.

    so it looks like this...
    define page_5 text
    rightboxheading
    rightboxcontent= 1

    here is what my code looks like on the tpl_more_information.php page
    $content = '';
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n" ;
    $add_a_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_PAGE_5, 'false');
    $content .= require($add_a_page);
    $content .= '</div>';
    the div appears below the define page content.

  8. #18
    Join Date
    Jun 2005
    Posts
    120
    Plugin Contributions
    0

    Default Re: How can I include a page in a sidebox?

    oh, and then i get a 1 inside the div, as if its telling me that $more_information exists...

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Categories Sidebox: How to always include subcategories?
    By lat9 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Mar 2010, 02:18 PM
  2. How can I include a php file in the header section?
    By Andy_R in forum General Questions
    Replies: 3
    Last Post: 11 Sep 2009, 05:50 PM
  3. How can sub-total include shipping??
    By Kitiarachan in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 4
    Last Post: 6 Nov 2007, 03:48 PM
  4. Can I include a defined page in another?
    By CheekyCockney in forum General Questions
    Replies: 3
    Last Post: 20 May 2006, 03:36 PM

Posting Permissions

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