Forums / Addon Sideboxes / how to add an additional sidebox in v1.x.x

how to add an additional sidebox in v1.x.x

Sticky

Views: 72,874

Results 21 to 40 of 44
3 Sep 2006, 8:21 AM
#21
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

how to add an additional sidebox in v1.x.x

Three comments here (one of which will answer your question).

These look like EZ-Pages links and so would have been easiest added by simply turning them on the EZ-Pages sidebox and then positioning that where you have put your sidebox. Maybe you're using that for something else.

Inserting EZ-Page links into code is best done by using the zen_ez_pages_link function.

This would turn your block into> zen_ez_pages_link(7);

zen_ez_pages_link(10);
zen_ez_pages_link(8);
zen_ez_pages_link(9);If you were using a chapter other than 0 you would need to add this as a 2nd parameter. The information displaying in each link would be the EZ-Page title. This solution is best because it automatically handles any changes to your site structure. For example if you wanted to change URL, re-use on a different site, or set up a test shop in a different directory on the same server, you would not need to change the code.

To stop the links coming up onto the same line (whether you have used your method or the zen_ez_page_link function, in your stylesheet either float them left or display as block to change them from inline to block elements and then give them width wide enough that one one can fit on a line.

Kuroi Web Design and Development | Twitter

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

15 Sep 2006, 3:22 AM
#22
prellis avatar

prellis

New Zenner

Join Date:
Jul 2005
Posts:
46
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

"To stop the links coming up onto the same line (whether you have used your method or the zen_ez_page_link function, in your stylesheet either float them left"

I tried this & it didn't work....

"or display as block to change them from inline to block elements and then give them width wide enough that one one can fit on a line."

How exactly do I do this? I have a longer text link of "Designer Spotlight" then the smaller one of "Press"...What would the width be to allow both to show up properly?

15 Sep 2006, 7:46 AM
#23
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: how to add an additional sidebox in v1.x.x

English is such an ambiguous language at times and I suspect that you have broken up the instructions in a different way to that intended. Here they are again with a bit more structure (and a corrected typo):

To stop the links coming up onto the same line (whether you have used your method or the zen_ez_page_link function), in your stylesheet:

  1. either float them left OR display as block to change them from inline to block elements and then

  2. give them width wide enough that only one can fit on a line.

How do you display them as a block? add display:block to their styling

What width should you make them? The width of the content in your sidebox would normally be: sidebox width - (left border width + right border width + left padding + right padding) and therefore a fairly good value to start with, though if you have used em as your unit for any of these settings, I would recommnd changing it to px first.

Kuroi Web Design and Development | Twitter

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

13 Sep 2007, 8:13 AM
#24
sobebabies avatar

sobebabies

Zen Follower

Join Date:
Sep 2006
Posts:
158
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

I just modified the blank sidebox template - thanks for that. I used just an image which is a link. There is a lot of empty space over it though, which confuses me as the sidebox below doesn't have that. Here is the source code for my side box - anything obvious for why there is empty space above the image?

<!--// bof: mysidebox //-->
<div class="rightBoxContainer" id="mysidebox" style="width: 151px">
<h3 class="rightBoxHeading" id="nmysideboxHeading">Stuff</h3>

<div id="mysideboxContent" class="sideBoxContent"><p><div style="text-align: center;"><a target="_blank" href="http://link/"><img
 alt="stuff"
 title="stuff"
 src="http://www.thingy.com/foo.gif""></a><br>
</p></div></div>
<!--// eof: mysidebox //-->
13 Sep 2007, 8:37 AM
#25
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: how to add an additional sidebox in v1.x.x

sobebabies:

anything obvious for why there is empty space above the image?Impossible to say for sure without seeing it in context as we need to see how the HTML and CSS interact, but there does does seem to be an awful lot of unnecessary HTML in that arrangement and if it's coming with its own padding and margins (particularly the <p> tag) that might explain the problem.

Kuroi Web Design and Development | Twitter

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

13 Sep 2007, 3:38 PM
#26
sobebabies avatar

sobebabies

Zen Follower

Join Date:
Sep 2006
Posts:
158
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

It's sobebabies.com. The box in question is the newsletter one - look at the source and search for "newsletter".

13 Sep 2007, 3:53 PM
#27
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: how to add an additional sidebox in v1.x.x

LOL. Turns out that it is the HTML after all. Some of that extra code is invalid. The paragraph and div inside it aren't nested properly and so the browsers are closing the paragraph tag themselves, creating an empty paragraph that nevertheless has height. This is the space that you don't want.

Here's what I'd recommend changing your code to produce```

<!--// bof: mysidebox //--> <div class="rightBoxContainer" id="mysidebox" style="width: 151px"> <h3 class="rightBoxHeading" id="mysideboxHeading">Stuff</h3> <div id="mysideboxContent" class="sideBoxContent"> <a target="_blank" href="http://link/"> <img alt="stuff" title="stuff" src="http://www.thingy.com/foo.gif" /> </a> </div> <!--// eof: mysidebox //--> ``` and then add the following to your stylesheet ``` #mysideboxContent {text-align:center} ```

Kuroi Web Design and Development | Twitter

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

15 Sep 2007, 5:23 PM
#28
sobebabies avatar

sobebabies

Zen Follower

Join Date:
Sep 2006
Posts:
158
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

Kuroi, thanks for your response. I played around with it and I made it worse and worse! Well for now, I have to go a little bit of a different route; now I have a cute little flash animation there (and yet even more white space above) and I can't work on it 'cause my designer's daughter just dropped her computer and there is no backup. Once she gets that figured out, perhaps I can come back to this. For now, it's gonna have to stay how it is; I can't be spending all my time on the little fun stuff when there are serious pressing issues to address. But I will be back when she gets me a clickable flash image! :D
Ellen

5 Jan 2009, 10:34 AM
#29
chicsinred avatar

chicsinred

New Zenner

Join Date:
Dec 2008
Posts:
4
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

Hi,
I wanted to create a new banner/sidebox and followed your instrutions. The sidebox appeared under the layour boxes controller and I had set it to what I want but it didn't appear under the configurations.

Did I miss something?

Thanks

20 Jan 2009, 1:53 PM
#30
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

chicsinred:

Hi,
I wanted to create a new banner/sidebox and followed your instrutions. The sidebox appeared under the layour boxes controller and I had set it to what I want but it didn't appear under the configurations.

Hi

ME TOO!!!! - Lets hope someone can help us out - I really searched all the files I created but couldn't see anything wrong - this zen cart is driving me mad - I feel that whilst trying to get my site up and running and looking ok I am taking 1 step forward and 4 backwards!!! :frusty:

Helen

12 Mar 2009, 1:52 AM
#31
bizshop1 avatar

bizshop1

New Zenner

Join Date:
Feb 2009
Posts:
9
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

Why is this so hard?
I've been struggling for days trying to get this right.
Why can't the admin section just have an option to "Create New Sidebox"?

12 Mar 2009, 9:14 AM
#32
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: how to add an additional sidebox in v1.x.x

bizshop1:

Why can't the admin section just have an option to "Create New Sidebox"?Because the Admin has no way of knowing what to put in the sidebox.

Most additional sideboxes are used to add functionality that is new to Zen Cart, so for which there is no programming available.

That's not always the case, extra category and banner boxes (for example) could re-use code already written. However this would need to be built into the structure of Zen Cart ... and has been for the forthcoming 2.0 release.

Kuroi Web Design and Development | Twitter

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

22 Nov 2009, 10:40 PM
#33
joe3b avatar

joe3b

New Zenner

Join Date:
Nov 2009
Location:
London
Posts:
67
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

Ajeh:

This could be added to the configuration table like the other Banner Group definitions, or it could be added to a define statement ...

Extra define statements are best added to the directory in a file that has meaning to you such as:
/includes/languages/english/extra_definitions/my_banners_box3.php

<?php define('SHOW_BANNERS_GROUP_SET10', 'BANNER GROUP NAMES GO HERE'); ?>

This would load at the same time as the english.php file ...

Or, you could add it to the configuration table in the same way all the other settings are added:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Banner Display Groups - Side Box banner_box3', 'SHOW_BANNERS_GROUP_SET10', 'SideBox-Banners', 'The Banner Display Groups can be from 1 Banner Group or Multiple Banner Groups<br /><br />For Multiple Banner Groups enter the Banner Group Name separated by a colon <strong>:</strong><br /><br />Example: Wide-Banners:SideBox-Banners<br />Default Group is SideBox-Banners<br /><br />What Banner Group(s) do you want to use in the Side Box - banner_box3?<br />Leave blank for none', '19', '73', '', '', now());

> 
> Then, you customize the new files for banners_box3 to use the changes described above ...
> 
> Example:
> 
> SHOW_BANNERS_GROUP_SET8
> 
> would become:
> 
> SHOW_BANNERS_GROUP_SET10
> 
> TEXT_BANNER_BOX2
> 
> would become:
> TEXT_BANNER_BOX3
> 
> ```php
    require($template->get_template_dir('tpl_banner_box2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_banner_box2.php');

would become:

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

So If I understand correctly I create a php file (called my_banner_box3)  containing:

<?php
define('SHOW_BANNERS_GROUP_SET10', 'MY BANNER NAME');
?>

OR I can change the codei n "tpl_banner_box3.php" 

and enter the code into the "Configuration table"?

```php
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Banner Display Groups - Side Box banner_box3', 'SHOW_BANNERS_GROUP_SET10', 'SideBox-Banners', 'The Banner Display Groups can be from 1 Banner Group or Multiple Banner Groups<br /><br />For Multiple Banner Groups enter the Banner Group Name separated by a colon <strong>:</strong><br /><br />Example: Wide-Banners:SideBox-Banners<br />Default Group is SideBox-Banners<br /><br />What Banner Group(s) do you want to use in the Side Box - banner_box3?<br />Leave blank for none', '19', '73', '', '', now());

Where can I find the Configuration table? :unsure:

23 Nov 2009, 12:43 AM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to add an additional sidebox in v1.x.x

The INSERT statement can be run in either Tools ... Install SQL Patches ... or you can run it in your phpMyAdmin for your database ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Nov 2009, 3:59 PM
#35
joe3b avatar

joe3b

New Zenner

Join Date:
Nov 2009
Location:
London
Posts:
67
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

Ajeh:

The INSERT statement can be run in either Tools ... Install SQL Patches ... or you can run it in your phpMyAdmin for your database ...

Thanks I show save this thread and try it out soon.

Since posting the previous message I've come across a number of sidebox add ons. Could I use any one of those and customise it how I like?

25 Nov 2009, 9:28 PM
#36
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to add an additional sidebox in v1.x.x

You can use an add on or make your own based on an existing sidebox as a model to make your new one ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

27 Feb 2010, 1:18 PM
#37
nicnic avatar

nicnic

New Zenner

Join Date:
Dec 2009
Posts:
3
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

O.k I'm struggling to understand this. I'm completely new to php, zen cart and coding in general.

All I want to do is add an additional 2 sideboxes to my main page below the existing two. I've followed the guide up untill;

Ajeh:

<?php define('SHOW_BANNERS_GROUP_SET10', 'BANNER GROUP NAMES GO HERE'); ?>

This would load at the same time as the english.php file ...

...

And now I'm lost. I don't know where that code should go or what my banner group name is. Could someone break it down a bit more for us beginners please?

I'm using Zen Cart 1.3.8a and my site is http://www.nmfurniture.com/

27 Feb 2010, 1:44 PM
#38
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to add an additional sidebox in v1.x.x

I am confused ...

You say you want to add new "sideboxes" ...

You show code for "banners" ...

What is it that you "really" want to do here ... :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

27 Feb 2010, 2:37 PM
#39
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: how to add an additional sidebox in v1.x.x

I'm curious. What would you put in an additional categories box? Wouldn't it just repeat what was already in your categories box??

www.alepia.ch Alepia suisse

27 Feb 2010, 4:35 PM
#40
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: how to add an additional sidebox in v1.x.x

You can do anything you like ...

Some want multiple categories sidebox with different conditions on them for when the show or don't show or what categories they include or don't include ...

They would not be "idenitcal" to one another ... they would have differences to them that make them unique in some manner ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!