Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Mar 2011
    Posts
    65
    Plugin Contributions
    0

    Default Adding a new sidebox

    I'm trying to add a new sidebox to my page on the left side, in between categories and information.

    http://kamskungfucinema.com/zencart/

    I added this file to /includes/templates/my template/sideboxes/

    <?php
    /**
    * Side Box Template
    *
    */
    $content = 'Check It Out!';
    ?>


    Then, I added this to /includes/modules/sideboxes

    <?php
    /**
    * check it out sidebox - used to display news to customers in a sidebox
    *
    */// test if box should display
    $show_welcome = true;if ($show_welcome == true) {require($template->get_template_dir('tpl_welcome.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_welcome.php');$title = BOX_HEADING_WELCOME;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    ?>

    But whenever I got to my admin to turn it on it just screws up my page, and no sidebox

    Did I do something wrong?

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

    Default Re: Adding a new sidebox

    How exactly is it screwing up? Can you select the sidebox to display? Does it give a white screen, or cut off output at that sidebox, or...?

    The filenames of the files you describe are tpl_welcome.php and welcome.php? And you have a file like /includes/languages/english/extra_definitions/your_template/welcome_defines.php where BOX_HEADING_WELCOME is defined?

  3. #3
    Join Date
    Mar 2011
    Posts
    65
    Plugin Contributions
    0

    Default Re: Adding a new sidebox

    I can turn the sidebox on--it's on now so you can see what it did to my site.


    ...as far as tpl_welcome.php and welcome.php I'm not sure that I have these files at all, I just copied the code from a tutorial I was reading to learn how to add an extra box

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

    Default Re: Adding a new sidebox

    You have to have /includes/modules/welcome.php for the new sidebox to be selectable in admin, and you have to have /includes/templates/your_template(or template_default)/sideboxes/tpl_welcome.php for it to display.

    When you turn the sidebox on, what is the name you are selecting?

  5. #5
    Join Date
    Mar 2011
    Posts
    65
    Plugin Contributions
    0

    Default Re: Adding a new sidebox

    the sidebox is called checkitout.php

  6. #6
    Join Date
    Mar 2011
    Posts
    65
    Plugin Contributions
    0

    Default Re: Adding a new sidebox

    ohh...I just looked and don't seem to have tpl_welcome.php under my custom template sideboxes.

    So I guess that's the problem?

    I don't seem to have any files in that folder actually besides the one I created a little while ago.

  7. #7
    Join Date
    Mar 2011
    Posts
    65
    Plugin Contributions
    0

    Default Re: Adding a new sidebox

    do I create this file or copy it from somewhere else?

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

    Default Re: Adding a new sidebox

    The code you posted is looking for a particular filename:

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

    If your module file is named checkitout.php, the sidebox tpl file should logically be named tpl_checkitout.php, and you can change the require accordingly.

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

  9. #9
    Join Date
    Mar 2011
    Posts
    65
    Plugin Contributions
    0

    Default Re: Adding a new sidebox

    Okay, I got it to appear, now how can I add other categories under it, and change the box color white like the others?

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

    Default Re: Adding a new sidebox

    You are missing most of the structural code that creates the sidebox content. Look at another sidebox tpl_ file like information and see what it has that yours doesn't, then adjust your tpl_ file accordingly. You may not need everything - compare several files to find the common elements.

    The easiest way to make a new sidebox is to download the Blank Sidebox mod from Free Addons - it has all the proper parts ready for you to customize.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. adding a new sidebox
    By gabstero in forum General Questions
    Replies: 4
    Last Post: 18 Oct 2012, 05:16 PM
  2. Adding a new sidebox
    By DannyVarley in forum General Questions
    Replies: 5
    Last Post: 7 Sep 2012, 07:05 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