Page 7 of 35 FirstFirst ... 5678917 ... LastLast
Results 61 to 70 of 347
  1. #61
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Quote Originally Posted by gjh42 View Post
    Yes, that should do it.
    So I did a qick test and I can get them to appear just below the main page defined text, and then just below the Featured, Special, New centerboxes.. Can't quite figure out how to get the midelboxes to appear between the category grid and the Featured, Special, New centerboxes. Will keep plugging at this..

    Quote Originally Posted by gjh42 View Post
    A more elegant way would be to have the middlebox code in its own file, so it just has to be called by perhaps one new line in the relevant tpl_index_ file. This would make maintaining and improving the middlebox code easier for the future. I have been doing this kind of thing for my mods as I update them.
    And truthfully I know this.. But HOW to do it has confounded me.. I'm happy to flounder through this on my own.. Can you give an example of one of your mods I could take a look at where you've done something similar so that I can try figuring this out on my own by copying off of YOUR homework??
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #62
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Quote Originally Posted by gjh42 View Post
    Oh, and tpl_index_categories.php is also used by interior category listing pages, so if the middleboxes are only supposed to appear on the homepage, you would have to have a test for that, or else put the middlebox call inside the (homepage-only) "$show_welcome" loop.
    Do you see the deer in the headlights look I now have?? Okay can you walk me through how I make this happen.. Its this one of those "if this is the home page" conditional statements I need to wrap around my middlebox code???
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  3. #63
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Yes, if ($this_is_home_page) { would do the job.

    Pretty much all of mine use functions, called from the appropriate custom version of a core file; one example is Smart Backgrounds.

    You might want to use a require() or include() statement to call a regular PHP file, which then does some figuring and calls as many functions as there are middleboxes active (or something). There are examples of this in tpl_main_page.php. If the actual middlebox code is the same structure for each, you could have a show_middlebox() function which takes arguments of the box name and whatever else could be unique for it... or maybe that wouldn't work - I don't know exactly what the various boxes do.

  4. #64
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Quote Originally Posted by gjh42 View Post
    Yes, if ($this_is_home_page) { would do the job.

    Pretty much all of mine use functions, called from the appropriate custom version of a core file; one example is Smart Backgrounds.

    You might want to use a require() or include() statement to call a regular PHP file, which then does some figuring and calls as many functions as there are middleboxes active (or something). There are examples of this in tpl_main_page.php. If the actual middlebox code is the same structure for each, you could have a show_middlebox() function which takes arguments of the box name and whatever else could be unique for it... or maybe that wouldn't work - I don't know exactly what the various boxes do.
    My deer in the headlights look just got bigger.. I am truly digging my self in deeper, but if I can do this I will enjoy the fruits of end result.. (thanks in a big way to you!!)

    These middleboxes are fairly simply.. There is one row of three middleboxes each which has it own defined page (to allow the shopowner easy access to update each one).. You can see what they look like here on my test site: http://zentestcart.overthehillweb.com/

    Gonna go look at your Smart Backgrounds mod and have a looksee.. Wish me luck..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #65
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Here is a sample of how you might structure the middlebox file and its call.
    PHP Code:
    <?php //snippet to go in tpl_index_default.php and tpl_index_categories.php
    if($this_is_home_page) require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_middlebox_controller.php');
    ?>
    Define MIDDLEBOX_QTY in a define file.
    PHP Code:
    <?php
    /**
     * Page Template
     *
     * Centerboxes are called as necessary
     *
     * @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
     *  /includes/templates/your_template/templates/tpl_middlebox_controller.php      test  gjh42 2010-09-20
     */
    ?>

    <!-- Begin Main Page Middleboxes -->
    <div id="navColumnMiddleWrapper">
    <?php
    for($i=1$i<=MIDDLEBOX_QTY$i++){
    ?>
    <div class="middleBoxContainer" id="middlebox_<?php echo $i?>">
    <h2 class="middleBoxHeading" id="middlebox<?php echo $i?>Heading"><?php echo constant('BOX_HEADING_MIDDLEBOX' $i?></h2>
    <div class="middleBoxContent" id="middlebox<?php echo $i?>Content">
    <?php require zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'constant('FILENAME_DEFINE_MIDDLEBOX_' $i), 'false');?>
    </div></div>
    <?php 
    }// /for ?>
    </div>
    <br class="clearBoth" />
    <!-- End Main Page Middleboxes -->

  6. #66
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    This arrangement would allow any page file to call the middleboxes, by inserting the require() (without the if test) in the desired location.

  7. #67
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Color me speechless!!! and GRATEFUL..I've been at a movie premier going over it in my head how to do this.. I am in awe of cool it is for you to help me with this.. Really it is..

    I had one more thought while I was out tonight that I think would be of use.. Gonna give some thought as to how to put it in play.. But I would like to make this whole thing a lot more admin configurable.. I've got an idea how to make the middleboxes something that can be turned on and off in the admin.. Want to think this all the way through.. If I can settle my head down I'm gonna try putting this altogether tomorrow.. Would love your thoughts once I'm done..

    Anyway.. I'm beyond grateful for your help..
    Quote Originally Posted by gjh42 View Post
    Here is a sample of how you might structure the middlebox file and its call.
    PHP Code:
    <?php //snippet to go in tpl_index_default.php and tpl_index_categories.php
    if($this_is_home_page) require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_middlebox_controller.php');
    ?>
    Define MIDDLEBOX_QTY in a define file.
    PHP Code:
    <?php
    /**
     * Page Template
     *
     * Centerboxes are called as necessary
     *
     * @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
     *  /includes/templates/your_template/templates/tpl_middlebox_controller.php      test  gjh42 2010-09-20
     */
    ?>

    <!-- Begin Main Page Middleboxes -->
    <div id="navColumnMiddleWrapper">
    <?php
    for($i=1$i<=MIDDLEBOX_QTY$i++){
    ?>
    <div class="middleBoxContainer" id="middlebox_<?php echo $i?>">
    <h2 class="middleBoxHeading" id="middlebox<?php echo $i?>Heading"><?php echo constant('BOX_HEADING_MIDDLEBOX' $i?></h2>
    <div class="middleBoxContent" id="middlebox<?php echo $i?>Content">
    <?php require zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'constant('FILENAME_DEFINE_MIDDLEBOX_' $i), 'false');?>
    </div></div>
    <?php 
    }// /for ?>
    </div>
    <br class="clearBoth" />
    <!-- End Main Page Middleboxes -->
    Quote Originally Posted by gjh42 View Post
    This arrangement would allow any page file to call the middleboxes, by inserting the require() (without the if test) in the desired location.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  8. #68
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Okay so I've got this partially working..

    I have now added a call to the tpl_index_default.php and tpl_index_categories.php to the newly created tpl_middlebox_controller.php.

    But the code for the tpl_middlebox_controller.php makes the right sideboxes disappear and the content below the main page greeting disappears. (middleboxes, featured products, new products, specials, footer, etc)

    So temporarily I've put the original middlebox code in the tpl_middlebox_controller.php just to test the call from tpl_index_default.php and tpl_index_categories.php (particularly the tpl_index_categories.php call). That all works beautifully.. (See http://zentestcart.overthehillweb.com/)

    I'm not entirely sure why I am getting the result I am getting.. **sigh**

    HELP!!

    Quote Originally Posted by gjh42 View Post
    Here is a sample of how you might structure the middlebox file and its call.
    PHP Code:
    <?php //snippet to go in tpl_index_default.php and tpl_index_categories.php
    if($this_is_home_page) require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_middlebox_controller.php');
    ?>
    Define MIDDLEBOX_QTY in a define file.
    PHP Code:
    <?php
    /**
     * Page Template
     *
     * Centerboxes are called as necessary
     *
     * @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
     *  /includes/templates/your_template/templates/tpl_middlebox_controller.php      test  gjh42 2010-09-20
     */
    ?>

    <!-- Begin Main Page Middleboxes -->
    <div id="navColumnMiddleWrapper">
    <?php
    for($i=1$i<=MIDDLEBOX_QTY$i++){
    ?>
    <div class="middleBoxContainer" id="middlebox_<?php echo $i?>">
    <h2 class="middleBoxHeading" id="middlebox<?php echo $i?>Heading"><?php echo constant('BOX_HEADING_MIDDLEBOX' $i?></h2>
    <div class="middleBoxContent" id="middlebox<?php echo $i?>Content">
    <?php require zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'constant('FILENAME_DEFINE_MIDDLEBOX_' $i), 'false');?>
    </div></div>
    <?php 
    }// /for ?>
    </div>
    <br class="clearBoth" />
    <!-- End Main Page Middleboxes -->
    Quote Originally Posted by gjh42 View Post
    This arrangement would allow any page file to call the middleboxes, by inserting the require() (without the if test) in the desired location.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #69
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Editable Home Page Centerboxes

    Do you have MIDDLEBOX_QTY defined somewhere? (Set to '3' for your standard 3 boxes.) I'm going to work on getting a new test site set up so I can debug things like this myself.

  10. #70
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Editable Home Page Centerboxes

    Quote Originally Posted by gjh42 View Post
    Do you have MIDDLEBOX_QTY defined somewhere? (Set to '3' for your standard 3 boxes.) I'm going to work on getting a new test site set up so I can debug things like this myself.
    Yes.. Not sure if I did this right though.. I created this file: includes/languages/english/extra_definitions/custom_template/middlebox_qty.php. Here are the contents:

    PHP Code:
    <?php
    /**
    * @package languageDefines
    * @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
    */

    // DON'T EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING!

    // This is used to display the number of middleboxes to display
        
    define('MIDDLEBOX_QTY''3');
    ?>
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 
Page 7 of 35 FirstFirst ... 5678917 ... LastLast

Similar Threads

  1. v154 Editable Invoices & Packing Slips [Support]
    By dbltoe in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 7 Oct 2015, 11:44 PM
  2. Admin-Editable Sidebox - Support Thread
    By kuroi in forum Addon Sideboxes
    Replies: 331
    Last Post: 29 Oct 2014, 04:15 AM
  3. Move Define Page Text to bottom of page, below centerboxes
    By AirsoftOutfitter in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Jul 2011, 02:13 AM
  4. Editable Home Page Centerboxes click-able links
    By colhemm in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 22 Feb 2011, 09:04 PM
  5. Image above centerboxes on main page
    By direwolf in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 May 2008, 06:40 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