Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Main Navigation Sidebox

    This is the support thread for the Main Navigation Sidebox add-on. This add-on allows you to relocate your main navigation links (home, log in, etc) from your site's header to a sidebox. It should work fine with all 1.3.x versions of Zen Cart.

    If you have any problems with the add-on, please read any previously answered questions, and if yours is new, feel free to post it below.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Main Navigation Sidebox

    The add-on can be downloaded from here.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Main Navigation Sidebox

    I've been hunting around for confirmation and clues of how to modify the login sidebox mod to do what I think this new mod does for me. Because of that, I've been comparing the code between the two mods and I have some comments/questions about this mod...

    1) My complaint with the login sidebox mod was that I wanted the login to be a link so that I could go to the split login page instead of having the login boxes right there in the sidebox. Assuming I am understanding how this mod works correctly, you coincidentally did my coding for me, so thanks!!

    2) I've got my own home button in my header navigation, so I don't need one in this box. Although it wouldn't hurt to have an extra, I think it'll look funny since it sits right next to the breadcrumbs which sits right under my home button. That's ALOT of home links in one small space!! If I decide to remove it, I think I just need to remove the first <li> from the $content string. Is there anything more to it than that which I'd need to understand?

    3) In the login sidebox mod, which is clearly based on old code, the FILENAME_SHOPPING_CART was coded as 'SSL', but I see now that this mod as well as the base code is coded as 'NONSSL'. If I understand this correctly it's a link to the user's shopping cart data, how come this gets served under the nonSSL side?

    Thanks - this turned out to be a very timely mod for me!! Karen

  4. #4
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Main Navigation Sidebox

    Oops, I forgot to mention you left a copy/modify typo in the code that will likely screw up some newbie coders! ...

    Line 17: // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19

    ----------------------------------------------------------|^

    should say: navmain_sidebox_defines.php

  5. #5
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Main Navigation Sidebox

    And last for the night...

    You might want to include this in the mod readme to prevent the bevy of questions you'll likely get repeated over and over again...

    To replace the sidebox title with an image
    1) Change the code in navmain_sidebox_defines.php from:
    define('BOX_HEADING_NAVMAIN_SIDEBOX', 'Site Navigation');
    to:
    define('BOX_HEADING_NAVMAIN_SIDEBOX', 'your_graphic_image.???');
    2) Change the code in navmain_sidebox.php from:
    $title = BOX_HEADING_NAVMAIN_SIDEBOX;
    to:
    $title = zen_image($template->get_template_dir(BOX_HEADING_NAVMAIN_SIDEBOX, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . BOX_HEADING_NAVMAIN_SIDEBOX, HEADER_ALT_TEXT);

    I haven't actually tried any of it yet, but there's little reason the technique should suddenly break! HTH Karen

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Main Navigation Sidebox

    Quote Originally Posted by busyMom View Post
    I wanted the login to be a link so that I could go to the split login page instead of having the login boxes right there in the sidebox. Assuming I am understanding how this mod works correctly, you coincidentally did my coding for me
    You understand correctly

    Quote Originally Posted by busyMom View Post
    I've got my own home button in my header navigation, so I don't need one in this box. Although it wouldn't hurt to have an extra, I think it'll look funny since it sits right next to the breadcrumbs which sits right under my home button. That's ALOT of home links in one small space!! If I decide to remove it, I think I just need to remove the first <li> from the $content string. Is there anything more to it than that which I'd need to understand?
    The code has been written so that the generation of link is done on its own line. You should remove the whole line to remove the link cleanly.

    Quote Originally Posted by busyMom View Post
    In the login sidebox mod, which is clearly based on old code, the FILENAME_SHOPPING_CART was coded as 'SSL', but I see now that this mod as well as the base code is coded as 'NONSSL'. If I understand this correctly it's a link to the user's shopping cart data, how come this gets served under the nonSSL side?
    This is more a question for the Zen Cart Development team. I have simply followed their lead. I would guess however that they have taken the view that since there is no personal information on the shopping cart page, there are no security implications requiring SSL. As there is a performance overhead in accessing SSL-protected pages, these are kept to a minimum. If you don't agree with this stance however, you can easily switch the page by changing NONSSL to SSL.

    Quote Originally Posted by busyMom View Post
    Oops, I forgot to mention you left a copy/modify typo in the code that will likely screw up some newbie coders! ...
    Thank you. I have re-commented the whole file and uploaded an version to the downloads area.

    Quote Originally Posted by busyMom View Post
    And last for the night...

    You might want to include this in the mod readme to prevent the bevy of questions you'll likely get repeated over and over again...

    To replace the sidebox title with an image ....
    I was in two minds about this, as I have a number of sidebox mods out there, and this would apply to all of them (and indeed all sidebox mods). However, I hope that people will learn from these mods, I have updated the readme (for this one) to explain how to replace the title with an image, and also how to suppress it completely. This new readme is part of version 1.1 which is now available from the downloads section.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Main Navigation Sidebox

    Quote Originally Posted by kuroi View Post
    The code has been written so that the generation of link is done on its own line. You should remove the whole line to remove the link cleanly.
    Thanks, Kuroi, I am familiar enough with coding to know this, I was just trying to shorthand what I was planning to do. I think it was wise for you to document it more clearly for future coders trying to do the same thing! Sorry about that!

    In reading your response about trying to make your sidebox mods available as a learning tool, it occurred to me that it could be made more robust and provide a stronger learning experience by building in the same changes I need to make for myself. There are probably other people who will ask "how do I ..." for some of this same customization I'm doing, so feel free to actually pickup these changes into the mod itself if you want. I'm not on my development computer right now to actually test these changes, so please feel free to correct any oopses I make here - I'm really just coding on the fly!!

    1) In navmain_sidebox_defines.php add three additional constants:
    Code:
     
    /* Configuration constants for navmain_sidebox
           Each of the three display options can be independently enabled or
           disabled by setting them to 'True' or 'False' appropriately. If you find
           yourself setting them ALL to 'False', then you should turn the 
           sidebox off via the admin Layout Boxes Controller instead of using 
           these constants or alternatively uninstall the mod altogether!
              DISPLAY_NAVMAIN_SIDEBOX_HOMELINK
                 controls whether or not to display the 'Home' link in this sidebox
              DISPLAY_NAVMAIN_SIDEBOX_LOGINLINKS
                 controls whether or not to display the 'Login', 'Logoff', and 
                 'Account' links at the appropriate time in this sidebox
              DISPLAY_NAVMAIN_SIDEBOX_CARTLINKS
                 controls whether or not to display the 'Shopping Cart' 
                 and 'Checkout' links at the appropriate time in this sidebox
    */ 
     
    define('DISPLAY_NAVMAIN_SIDEBOX_HOMELINK','True'); 
    define('DISPLAY_NAVMAIN_SIDEBOX_LOGINLINKS','True'); 
    define('DISPLAY_NAVMAIN_SIDEBOX_CARTLINKS','True');
    2) In tpl_navmain_sidebox.php make the changes in red:
    Code:
     
    // home page link
    if (DISPLAY_NAVMAIN_SIDEBOX_HOMELINK == 'True') {
      $content .= '<li><a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . HEADER_TITLE_CATALOG . '</a></li>' . "\n";
    }
     
    // IF customer is logged in display Log Off and My Account links
    if (DISPLAY_NAVMAIN_SIDEBOX_LOGINLINKS == 'True' {
      if ($_SESSION['customer_id']) {
        $content .= '<li><a href="' . zen_href_link(FILENAME_LOGOFF, '', 'SSL') .'">' . HEADER_TITLE_LOGOFF . '</a></li>' . "\n";
        $content .= '<li><a href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a></li>' . "\n";
      } else {
        // OR provided the store is not a showcase, display the Log In link 
        if (STORE_STATUS == '0') {
          $content .= '<li><a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . HEADER_TITLE_LOGIN . '</a></li>' . "\n";
        }
      }
    }
     
    // IF customer has items in their stopping cart display the Shopping Cart and Checkout links
    if (DISPLAY_NAVMAIN_SIDEBOX_CARTLINKS == 'True') {
      if ($_SESSION['cart']->count_contents() != 0) {
        $content .= '<li><a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . HEADER_TITLE_CART_CONTENTS . '</a></li>' . "\n";
        $content .= '<li><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . HEADER_TITLE_CHECKOUT . '</a></li>' . "\n";
      }
    }
    Thanks for your quick response to my questions. I and thousands of other ZenCart newbies really appreciate your help!!
    Karen

  8. #8
    Join Date
    Aug 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Main Navigation Sidebox

    I have one HUGE question. I am having troubles getting the Main Navigation Sidebox add-on to be the same size as the rest of my side boxes. I have them all set at 150px but the Navigation Box seems to stay bigger then the rest. Any ideas on how I can change it to fit in?

    If you want to check out my store to see what I mean, please go to:
    http://www.taradunstandesigns.net/boutique

    Thanks heaps for any help in advance :)

    Cheers,
    Tara

  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Main Navigation Sidebox

    I can't see the main navigation sidebox on your site and so can't diagnose the problem. One possibility would be that you have unbroken text in there that forces the box to overflow the width that you have given it.

    You also have a login sidebox that is overflowing its allocated width. To deal with this you would have to edit the size attributes in the code that generates the input fields for the email address and password.

    Also your thumbnail image files are way to big. They'e detailed files and you want them to look good, but you would get better-looking and faster loading images if you used a specialist tool to reduce the image sizes rather than trusting your users' browsers to do the job.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Aug 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Main Navigation Sidebox

    Thank you so very much for your help kuroi! I will go have a play around with it now and also resize all the thumbnails too. Appologies for the delay in getting back. Life is full on lately. Aghhhh. LOL.

    Thanks heaps again :)

    Cheers,
    Tara

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Navigation main changes
    By fusionsp in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 17 Aug 2009, 03:45 PM
  2. Main Navigation Bar
    By kdiscrete in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Jan 2009, 06:31 AM
  3. Main Navigation
    By justinae in forum General Questions
    Replies: 5
    Last Post: 10 Nov 2007, 08:11 PM
  4. Removing Main navigation bar except on Main page
    By Redcinamn in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Oct 2007, 08:39 AM

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