Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to replace sidebox with my own navigation?

How to replace sidebox with my own navigation?

Locked

Views: 1,858

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
17 Nov 2008, 5:16 PM
#1
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

How to replace sidebox with my own navigation?

I want to replace the left sidebox with my own navigation. Can someone give me a rough outline or what to do, or point me in the right direction? I am familiar with the overrides system. I'm just not sure what pages to look at.

You can see the site I'm building here:
https://www.collabiril.com
Notice the navigation on the left. I want that to appear in all of my store pages.

To see my store as it exists so far, go to:
https://www.collabiril.com/shop
I still have the left sidebar there, and that's what I want to replace.

17 Nov 2008, 5:21 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to replace sidebox with my own navigation?

There are a couple ways to do that. If I were doing it, I'd install the Blank Sidebox mod and insert links to the pages in that, and style the HTML in the stylesheet.. It's a nice mod, and easy to install.

17 Nov 2008, 5:32 PM
#3
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Thanks. I haven't done anything with mods yet. Where do I find it?

17 Nov 2008, 5:48 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to replace sidebox with my own navigation?

Top of this page - Free Software Add Ons

Search for 'blank'.

Lots of cool stuff in there.

17 Nov 2008, 9:14 PM
#5
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Thanks. Now, having never used an addon before, I have a question. The instructions say to "drag the includes folder to the root directory". But won't that wipe out my existing includes folder?

I think I should just move the files up to my site one by one, mimicking the structure of the unzipped files. But placing them in my "custom" folders. Right?

17 Nov 2008, 9:27 PM
#6
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Do I have to do something to enable this addon?
I copied the files as follows (from the zipped files on my local disk up to my server):

includes/languages/english/extra_definitions/blank_sidebox_defines.php
to
includes/languages/english/extra_definitions/custom/blank_sidebox_define.php

includes/modules/sideboxes/blank_sidebox.php
to
includes/modules/sideboxes/custom/blank_sidebox.php

includes/templates/template_default/sideboxes/tpl_blank_sidebox.php
to
includes/templates/custom/sideboxes/tpl_blank_sidebox.php

But nothing is "kicking in". There is no change to my page.

17 Nov 2008, 9:30 PM
#7
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

You can just drag the includes folder to your root- it won't delete all the other contents.

But then, you won't know which files to upload. Unless you upload the entire includes folder...which might overwrite some things that you changed in the admin > define pages editor.

Happened to me when I used the mod for the first time.

Sometimes I just bust out pencil and paper and write down every path/to/file, copy them to the proper directory, and then ftp the indivdual files.

17 Nov 2008, 9:34 PM
#8
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Did you go to admin > tools > layout boxes controller and enable it?

17 Nov 2008, 9:41 PM
#9
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Nope! Didn't know I had to do that. I'm new ... only my 5th day working the Zen Cart. Sure would have been nice if the instructions said to be sure to enable it and told you how. Of course, now I'll know for any future addons. But this being the first, I had no idea. I even googled "how to use addons in zen cart" and did not come up with the solution.

So just for the record: I only wanted the left sidebox, so in tools > layout boxes controller, for sideboxes/custom/blank_sidebox.php, I set "Left/Right Column Status" to ON, and "Single Column Status" to "ON".

Thanks again for your help.

17 Nov 2008, 10:25 PM
#10
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

So I'm having just a little trouble understanding how to put my content in.

I've added this to the tpl_blank_sidebox.php file:

$content .= '<div id="navmain"> '
$content .= '<ul>'
$content .= '<li id="nav1"><a href="index.php">home</a></li>'
$content .= '<li id="nav2"><a href="how.php">how does it work?</a></li>'
$content .= '<li id="nav3"><a href="what.php">what''s in it?</a></li>'
$content .= '<li id="nav4"><a href="faq.php">product FAQ</a></li>'
$content .= '<li id="nav5"><a href="order.php">order now</a></li>'
$content .= '</ul>'
$content .= '</div>'

It basically makes my whole page go away, other than my logo and the zen navigation. SO something is obviously wrong.

I also tried:

$content .= '<div id="navmain">

<ul> <li id="nav1"><a href="index.php">home</a></li> <li id="nav2"><a href="how.php">how does it work?</a></li> <li id="nav3"><a href="what.php">what''s in it?</a></li> <li id="nav4"><a href="faq.php">product FAQ</a></li> <li id="nav5"><a href="order.php">order now</a></li> </ul> </div>'

Same problem. HELP!

17 Nov 2008, 10:27 PM
#11
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Oh Boy! For the new kid on the block, you are doing well. Are we having fun yet? :clap:

It won't be long until you are actually answering questions in this forum. We look forward to your progress.

17 Nov 2008, 10:38 PM
#12
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Yeah but why doesn't it work? I even tried to just add this simple line to what's already there:

$content .= '<a href="index.php">home</a>';

and it still gives me an empty screen (only my logo and zen nav bar)

17 Nov 2008, 10:38 PM
#13
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Why not just write it in html? Works for my custom sideboxes:

http://www.lyonslimited.com/catalog/

17 Nov 2008, 10:55 PM
#14
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

OK. So I figured out that this works:

$content .= '<div id="navmain">

<ul> <li id="nav1"><a href="index.php">home</a></li> <li id="nav2"><a href="how.php">how does it work?</a></li> <li id="nav3"><a href="what.php">what is in it?</a></li> <li id="nav4"><a href="faq.php">product FAQ</a></li> <li id="nav5"><a href="order.php">order now</a></li> </ul> </div>';

BUT ... get this ... what I originally had for my nav4 item was:
what's in it?

not

what is in it?

The apostrophe is what was screwing everything up!
I tried using double apostrophe's to escape it, but that doesn't work either.
How can I get the apostrophe in there?

17 Nov 2008, 11:51 PM
#15
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

The apostrophe doesn't really matter as I use image replacement in my style sheet.

BUT

I can't figure out how to change the width of the sidebox?

I went to tools>configuration and set "Column Width - Left" to 200px (it was 150px). This only made more room for the sidebox - that is, it added blank space to the right of it. But it didn't actually change the width of the box.
I've successfully edited leftBox styles to get rid of header and border, but I can't figure out where to expand the width.
I found a post that said to do it with the h3.leftBoxHeader style, but that didn't work.You can see it here:
https://www.collabiril.com/shop
You can see that my text (actually images) are getting cut off because the box is not wide enough.

HELP! :frusty:

18 Nov 2008, 2:29 AM
#16
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Duh. I'm brain dead. In the layout options, there is also "Column Width - Left Boxes". Had to change that to 200px too! :oops:

18 Nov 2008, 3:26 AM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to replace sidebox with my own navigation?

Yep, that's one of the "legacy" things - features added piecemeal, and not always coordinated in location/style with existing features, and things inherited from the osCommerce origins of Zen Cart which haven't been updated yet. I'm not sure why those two aren't right next to each other. The admin is scheduled for a complete makeover in a future version, after critical customer experience and efficiency upgrades have been completed (see the roadmap at the top of the forum).

It is worthwhile to spend the time to go through every tab in admin and at least look at every item, even if you don't think it is relevant to you. When you need to edit something, you may remember that you saw it in a certain place.

18 Nov 2008, 4:14 PM
#18
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to replace sidebox with my own navigation?

For future reference, you can escape apostrophes with a backslash.

18 Nov 2008, 4:38 PM
#19
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

Great. Thanks!

30 Nov 2008, 3:54 PM
#20
emmtqg avatar

emmtqg

New Zenner

Join Date:
Oct 2008
Posts:
7
Plugin Contributions:
0

Re: How to replace sidebox with my own navigation?

I just started with zen-cart too! And looking to do a custom side box so you're note popped up on my search. I don't know much zen, but the code here looks like you just have a PHP formatting problem - you need to have a valid PHP string. So to create the string you want correctly in PHP:

$content = '<div id="navmain"> '; // notes: No period before the equals before you start your content string (if you want to start it fresh). This, btw is a PHP comment
$content .= '<ul>'; // Semicolon after each statement and in each of your following statements
$content .= '<li id="nav1"><a href="index.php">home</a></li>';
$content .= '<li id="nav2"><a href="how.php">how does it work?</a></li>';
$content .= '<li id="nav3"><a href="what.php">what''s in it?</a></li>';
$content .= '<li id="nav4"><a href="faq.php">product FAQ</a></li>';
$content .= '<li id="nav5"><a href="order.php">order now</a></li>';
$content .= '</ul>';
$content .= '</div>';

Or, another way - using the HERE doc syntax (http://us3.php.net/manual/en/language.types.string.php%29:

$content = <<<EOS

<div id="navmain"> <ul> <li id="nav1"><a href="index.php">home</a></li> <li id="nav2"><a href="how.php">how does it work?</a></li> <li id="nav3"><a href="what.php">what''s in it?</a></li> <li id="nav4"><a href="faq.php">product FAQ</a></li> <li id="nav5"><a href="order.php">order now</a></li> </ul> </div> EOS;

Good luck w/ the side box and thanks for posting your experience with it as I have learned something before I add my blank sidebox!