Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.

Creating new sidebox

Locked

Started by jayr on 27 Jan 2010, 2:08 AM · Views: 1,573

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
27 Jan 2010, 2:08 AM
#1
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #1 by jayr

I must have fried my brain and can't see anymore. How do I create a new (blank) sidebox in the left column? I want to put new links in there. Is it within files, the administrator access, or do I need download a mod for it?

27 Jan 2010, 5:05 AM
#2
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Post #2 by canopy

There's a Blank Sidebox mod in the Free Software Add Ons area.

To create links in the blank sidebox, you can refer to the code from other default Zen Cart sideboxes.

Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
Printed book: www.lulu.com/content/10576284
Electronic book and Errata: www.cucumbermedia.com/store

28 Jan 2010, 5:42 PM
#3
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #3 by jayr

Thank you so much! This is exactly what I needed.

28 Jan 2010, 9:35 PM
#4
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #4 by jayr

One more question. To match the website design I need to put in the new sidebox several links, all contained in a table, each link in a separate row. The rows have the mouseover effect - done with css code - to change the bgr color. Here's an example of a code of one row:

<TD class=cell onmouseover="this.bgColor='#05A2C7'" onmouseout="this.bgColor='#333333'" height=25 vAlign=center align=left>
<a href="http://www.website.com">Home</a> </TD>

Now, when I place this in the blank_sidebox_defines.php file I have a conflict of ( ' ) symbol. So when I put the above code I have ( ' ) symbol repeated again in this.bgColor='#333333'. Since this symbol supposed to open and close the whole html code, I create a conflict by using it again in the middle.

What is the way to include html code that has css commends with ( ' ) symbol and make it work?

28 Jan 2010, 9:59 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Post #5 by gjh42

In some cases, you can avoid the overlapping quotes syndrome by using single ' and double " quotes for container and content. In this case, there are too many levels of quote nesting, and you will need to escape the quotes with a backslash, like this ' .

29 Jan 2010, 12:09 AM
#6
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #6 by jayr

Thank you! This took care of it.

I have only one thing left in the new sidebox to match the rest of the website. It's the appearance/color of links. On the non-Zencart pages I have regulated it by css commend:

.websitenav {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #CCCCCC;
text-decoration: none;
padding: 6px;
margin: 0px;
}

So I added the above to the stylesheet.css and then assigned A class=websitenav to each link. It took care of the font, its size, etc except the color of the links. They are still blue and red on hover. My intention is to have the both, link nad hover in #CCCCCC.

Could you please help me with this?

29 Jan 2010, 10:43 AM
#7
stevesh avatar

stevesh

Black Belt

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

Post #7 by stevesh

You'll need to do something like:

.websitenav a {
color: #ff0000;
}

.websitenav a:hover {
color: #0000ff;
}

29 Jan 2010, 5:20 PM
#9
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #9 by jayr

Thank you guys for responding.

For some reason it doesn't work. I have a class asigned to the link and that class has also been added to stylsheet.css so it should work. However it seems like the default settings for links prevails. Please have a look at the left side column in grey and move cursor over the links to see what I mean: http://prodigicontrols.com/buy

Are there other elements in stylsheet that regulates the boxes in the left column that may do this? Maybe there is a way to do that with javascript embeded in html of my new box? I'm not any expert in all of this so I may sound a bit non-sensensical. My apology if that's the case. If this can be any help, here's html code of my links in the sidebox. It's in the blank_sidebox_defines.php file.

define('TEXT_BLANK_SIDEBOX', '<TABLE width="214" border=0 cellPadding=0 cellSpacing=0 bgcolor="#333333">

<TBODY><TR> <TD height=25 vAlign=center align=left><img src="http://prodigicontrols.com/images/2x12.gif" width="2" height="32"></TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com">Home</A> </TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/aquabox.htm">AquaBox Specifications </A></TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/applications.htm">Applications</A></TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/qa.htm">Q & A</A></TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/order.htm">Order Online</A></TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/about.htm">About Us </A> </TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/contact">Contact Us</A> </TD></TR> <TR><TD bgColor=#cecece height=1></TD></TR> </TBODY> </TABLE>');
29 Jan 2010, 5:38 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Post #10 by gjh42

You have

<A class=websitenav

and similar constructions throughout your code. All parameters like classname need to be in quotes:

<A class="websitenav"

29 Jan 2010, 6:05 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Post #11 by gjh42

You are using a table with all its elements hard-coded in the HTML. That is a lot of code that is inappropriately used. What you have is a list of items, and you should use a <ul> list instead of a table for it.
Instead of```html

<TABLE width="214" border=0 cellPadding=0 cellSpacing=0 bgcolor="#333333"> <TBODY><TR> <TD height=25 vAlign=center align=left><img src="http://prodigicontrols.com/images/2x12.gif" width="2" height="32"></TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com">Home</A> </TD></TR> <TR><TD bgColor=#cecece height=1 vAlign=center align=left></TD></TR> <TR><TD class=cell onmouseover="this.bgColor=\'#05A2C7\'" onmouseout="this.bgColor=\'#333333\'" height=25 vAlign=center align=left><A class=websitenav href="http://www.prodigicontrols.com/aquabox.htm">AquaBox Specifications </A></TD></TR> ... ``` use```html <div class="websitenav"> <img src="http://prodigicontrols.com/images/2x12.gif" width="2" height="32"> <ul> <li><A href="http://www.prodigicontrols.com">Home</A> </li> <li><A href="http://www.prodigicontrols.com/aquabox.htm">AquaBox Specifications </A></li> ... ``` and put in your stylesheet``` .websitenav { width: 234px; background-color: #333333; }

.websitenav ul li {
border-top: 1px solid #cecece;
height: 25px;
}

.websitenav ul li:hover {
background-color: #05A2C7;
}

.websitenav ul li a {
color: #cccccc;
}

.websitenav ul li a:hover {
color: #cccccc;
}

30 Jan 2010, 1:14 AM
#12
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #12 by jayr

Thank you so much Glenn. I'm learning a lot from you and I appreciate the time you take to do this. I love your solution - it's elegant and simple.

I've applied it and I got close to what it should be (a look of the website), but not close enough to go with it. The list ul li creates the left side space (intend) with a dot in front of each line. It's not what the rest of website has and I really can't apply it. See the left side column on the site http://prodigicontrols.com (that's what it supposed to be like).

I have also experimented with <blockquote> in place of list, but it did not helped.

I also went back to html code with just a three row table. I fixed the class assigned to each link so it had everything in place. However, it still applied Zen-cart default colors for 'a' and hover. I even created a simple html plain text link and assigned to it my A class (websitenav) and still the colors are from Zen-cart default settings. However, the font, size, decoration are controlled by my 'websitenav.' I have left it on the server so maybe you can have a look at it: http://prodigicontrols.com/buy

Is there still a solution that may do the trick? If you wish I can put back on the server the list ul li solution for your viewing.

Again, I'm deeply gratful for what you do for me.

30 Jan 2010, 2:31 AM
#13
gjh42 avatar

gjh42

Black Belt

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

Post #13 by gjh42

The <ul> can be styled however you want. Getting rid of the bullet is done by adding list-style: none; to the rule:```
.websitenav ul li {
border-top: 1px solid #cecece;
height: 25px;
list-style: none;
}

30 Jan 2010, 2:45 AM
#14
gjh42 avatar

gjh42

Black Belt

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

Post #14 by gjh42

Seeing your main site nav and your shop, I observe that there is a still easier way to get the nav sidebox you want: ez-pages. You can create ez-page external or internal links with the names you want, enable them in the ez-pages sidebox, and style the links with your stylesheet to look just like the main site. No PHP or HTML coding needed at all, just CSS.

30 Jan 2010, 7:54 PM
#15
jayr avatar

jayr

New Zenner

Join Date:
Jan 2010
Posts:
15
Plugin Contributions:
0

Post #15 by jayr

Thank you for the ez-pages direction. How do I get the links show up in my blank_sidebox? In the ez-pages setup there is a choice of 'sidebox' and if I choose it then they show up in the right side column box called "Important Links." I have a feeling that maybe by playing with order I can get them into blank sidebox? I have tried different order numbers for sidebox, but didn't move out of "Important Links."

1 Feb 2010, 6:56 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Post #16 by gjh42

The "sidebox" setting is for the ez-pages sidebox (titled "Important Links").

If you want to use them separately, you can turn off the ez-pages from sidebox (but keep the sort order), and use the zen_ez_pages_link(##) function (where ## is the ez-page id) in your blank sidebox. You need to ensure that it is used as PHP code and not HTML text markup.
Similar to this:

<?php echo zen_ez_pages_link(##) ?>

for each link.