Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Jul 2006
    Posts
    60
    Plugin Contributions
    0

    Default How To Create Your Own sidebox in v1.3.x

    A sidebox consists of three files, which are located in the includes directory:
    1. modules/sideboxes/custom/name_of_sidebox.php
    2. languages/english/extra_definitions/custom/
      name_of_sidebox_defines.php
    3. templates/custom/sideboxes/tpl_name_of_sidebox.php

    You need to replace custom and name_of_sidebox with your template name and the sidebox name respectively.
    For example, let us build a sidebox named my_sidebox. Then, my_sidebox.php file will read like this:
    ####################################################################################################____
    <?php
    $show_my_sidebox = true;
    if ($show_my_sidebox == true){
    require($template->get_template_dir('tpl_my_sidebox.php',
    DIR_WS_TEMPLATE, $current_page_base,'sideboxes').
    '/tpl_my_sidebox.php');
    $title = BOX_HEADING_MY_SIDEBOX;
    $left_corner = false;
    $right_corner = false;
    $right_arrow = false;
    require($template->get_template_dir($column_box_default,
    DIR_WS_TEMPLATE, $current_page_base,'common') .
    '/' . $column_box_default);
    }
    ?>
    ####################################################################################################____
    This page actually defines what is to be shown in that sidebox. Note that this page also includes the corresponding template file. Here, we have used a constant BOX_HEADING_MY_SIDEBOX.

    You need to define this in the includes/languages/english/extra_definitions/custom/my_sidebox_defines.php file. This file will look like this:
    ####################################################################################################____
    <?php
    define('BOX_HEADING_MY_SIDEBOX', 'My Sidebox');
    ?>
    ####################################################################################################____
    Now, you have to build its template file includes/templates/custom/sideboxes/tpl_my_sidebox.php
    which will read as:
    ####################################################################################################____
    <?php
    $content = "This is my first Sidebox. I have created it in 5 minutes. Although it is not of practical use yet, I hope I can eventually build a good sidebox.";
    ?>
    ####################################################################################################____

    NOTE: Remember to replace custom with your over rides template name. And Remember to place them in the right folder paths. PLease comment if this helped you. I will post more on other features later.
    Last edited by MadPricerSales; 30 Mar 2010 at 04:23 AM. Reason: misspelled words

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: How To Create Your Own sidebox

    ... or you could just go HERE
    20 years a Zencart User

  3. #3
    Join Date
    Jul 2006
    Posts
    60
    Plugin Contributions
    0

    Default Re: How To Create Your Own sidebox

    Quote Originally Posted by schoolboy View Post
    ... or you could just go HERE
    Yes you could, but doing it yourself will help you to see how the php code works. Learning by doing. Plus will allow you to see how the overrides work.

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: How To Create Your Own sidebox

    I'm not an airline pilot, so if I want to go to New York from London, I buy an air ticket... I don't train to be a pilot.

    There may be some merit in the "tutorial" aspect of what you are suggesting, but why re-invent the wheel?
    20 years a Zencart User

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

    Default Re: How To Create Your Own sidebox

    If you do want to build the files yourself, you should leave out the

    $left_corner = false;
    $right_corner = false;
    $right_arrow = false;

    as these are from a very old version of the sidebox and not actually used for anything in the current version of Zen Cart.

  6. #6

    Default Re: How To Create Your Own sidebox

    Actually, I find this board to be helpful, just what I was looking for. Thanks.
    Of course I went mad with power. Have you ever tried going mad without power? It's boring. No one listens to you.

  7. #7
    Join Date
    May 2010
    Posts
    18
    Plugin Contributions
    0

    Default Re: How To Create Your Own sidebox

    Yes good info. This also gives me the info to modify existing sideboxes in a way as now I know how they actually work.. Thanks for the thread..

  8. #8
    Join Date
    Nov 2009
    Location
    england
    Posts
    36
    Plugin Contributions
    0

    help question Re: How To Create Your Own sidebox in v1.3.x

    Hi there

    I so far have been able to follow your thorough and clear instructions and the sidebox is now in my admin panel. I am stuck however on what to do next because I have created a menu using coffecup, which is in text/javascript form and I am not quite sure where I should put this code instead of having the normal catagories sidebox, are you able to advise at all?

    Many thanks in advance.

    Claire :)

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

    Default Re: How To Create Your Own sidebox in v1.3.x

    You might try searching the forum for info on using javascript in sideboxes.
    What are you trying to achieve with your custom categories-type menu? Unless you have integrated the PHP logic that builds it from the database, your hard-coded menu will be static and need to be edited manually every time a category changes.
    There are existing mods in Free Addons for a number of common category menu arrangements.

  10. #10
    Join Date
    May 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: How To Create Your Own sidebox in v1.3.x

    Hi, is there a way to build multiple sideboxes that will display different EZ page links in each box? Or is there another way of achieving it? My intentions are to have different groups of static page links in different boxes if it is possible at all. I also would be setting different heading names for each box.

    Thanks.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Can I create my own Sidebox?
    By cryptoreporter in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 24 Oct 2014, 10:50 AM
  2. Create your own product bundles mod
    By slanphear in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Dec 2011, 05:00 PM
  3. create your own ‘Add this to my cart’ buttons ?
    By jamesdavid in forum General Questions
    Replies: 0
    Last Post: 27 Jun 2008, 12:12 PM
  4. Installed? Now create your own template
    By kuroi in forum Basic Configuration
    Replies: 21
    Last Post: 23 Sep 2007, 04:15 AM
  5. How do i create my own sideboxes?
    By Jodz in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Nov 2006, 02:58 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR