Forums / Basic Configuration / custom sidebox, i.e. perhaps for SSL or trust seal

custom sidebox, i.e. perhaps for SSL or trust seal

Locked

Views: 14,841

Results 21 to 34 of 34
This thread is locked. New replies are disabled.
26 Nov 2008, 5:08 AM
#21
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

custom sidebox, i.e. perhaps for SSL or trust seal

What I would like to do ultimately, is have the 2 banner side boxes display the same banners at all times. I will need to know how to do this once we have adds that link externally. We will need the stats you get with the banners when this happens.

Tooty Fruity

26 Nov 2008, 6:25 AM
#22
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

"I did end up using the blank sidebox contribution in the end. I had a slight problem with it... I tried to duplicate it, renaming the 3 files and the code in them. I wanted 2 pemanent adds in both rifgt and left columns. I managed to display 2 different headers for each sidebox but the images were the same, even though I had different image links in each "blank_sidebox_defines.php" and "blank_sidebox_defines2.php" file."


For your duplicated blank sidebox check the content of the /includes/modules/sideboxes/blank_sidebox2.php file to make sure it has the line

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

It may be that your duplicated sidebox is using the first sidebox template for it's content.

If that doesn't solve the problem have a close second look through the files to make sure you updated all of the filenames and variables correctly.


"What I would like to do ultimately, is have the 2 banner side boxes display the same banners at all times. I will need to know how to do this once we have adds that link externally. We will need the stats you get with the banners when this happens."


Do you mean have the two banner sideboxes display the same banner as each other (with perhaps multiple banners images in the rotation)? So both banners would have, say, four banners that could be displayed, but they always display the same one as each other. If so then you could come up with code in the template file for each banner that saved some global variable when the sidebox is displayed. If the variable hasn't been set then the first sidebox would randomly select a banner to display and then declare a variable with the value of the chosen banner. The second time the banner sidebox is displayed it will find that the variable has been declared, and will then display the same banner as the first banner sidebox.

30 Nov 2008, 11:36 PM
#23
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Thanks for the response, sorry about the time I took to reply, I did check the code in both blank sideboxes and the code in blanlk_sidebox2.php does call on tpl_blank_sidebox2.php, heres it is:

$show_blank_sidebox = true;

if ($show_blank_sidebox == true) {
require($template->get_template_dir('tpl_blank_sidebox2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox2.php');
$title = BOX_HEADING_SHOP_LOCATION_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

I would just like to be able to choose what add is displayed in "sideboxes/banner_box" and "sideboxes/banner_box2". My boss doesn't want these to display adds dynamically. He wants to choose what adds appears, and on what page. Is there a way to tell these banner boxes to do this?

Tooty Fruity

1 Dec 2008, 11:13 PM
#24
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

In your code you could try changing it to

$show_blank_sidebox2 = true;

if ($show_blank_sidebox2 == true) {
require($template->get_template_dir('tpl_blank_sidebox2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox2.php');
$title = BOX_HEADING_SHOP_LOCATION_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}

If I was creating a sidebox that displayed particular banners based on the current page I would create sidebox script with array of page => banner combinations. The script in the sidebox would check if the current page URL is in the array and then display the associated banner if it is. If the URL isn't in the array the script would display a default banner.

24 Jun 2009, 1:46 PM
#25
mafiasam avatar

mafiasam

Zen Follower

Join Date:
Jan 2006
Location:
Portland, Oregon
Posts:
256
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Thanks for this contribution Rowana

I love it because it's quick and dirty. I can add little snippets of code for just about anything.

So far I've used them for

PayPal logos
SSL seals
Page Rank Checker code

It literally takes about two minutes to add a custom side panel and I don't have to worry about modifying any of the core files. It's just one file placed in a template folder.

Brilliant.

Thanks again.

OldWestPokerSupplies.com – Custom Poker Chips and Other Professional Poker Supplies
Zen Cart 1.3.9.h with Google Base Feeder, Share Bookmarking Widget, Ultimate SEO URL, A Black Pure Template, Quick Updates, Sitemap XML and reCAPTCHA.

24 Dec 2009, 2:35 AM
#26
duckbill avatar

duckbill

New Zenner

Join Date:
May 2007
Location:
Lake Superior
Posts:
27
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

This method for easily inserting images in columns should be one of the top 10 best zen cart improvement tips. So easy a DuckBill can do it! Thanks for offering this method for us that don't daydream about php code...:sleep:


29 Dec 2009, 4:34 AM
#27
gpdmtr25 avatar

gpdmtr25

New Zenner

Join Date:
Oct 2009
Location:
Burbank, CA
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Can someone help me out? I tried doing this using the below code but all I get is a little box with a red X. So the side box is showing up but the image must not be linked correctly. Is the code incorrect?
Thanks
Angela

<?php // ----------------------------------- // MY Custom SIDE PANEL ITEM // ----------------------------------- // test if box should display $show_iap = true; if ($show_iap == true) { ?>
   <div align="center" style="padding:5px;">
   <a href="http://www.penturners.org" target="_blank"> <img src="http://www.thecreativepencompany.com/includes/templates/custom/images/iap.jpg" border="0" alt="IAP Logo"> </a>
   </div>	
 
<?php }

?>

1 Jan 2010, 1:30 AM
#28
gpdmtr25 avatar

gpdmtr25

New Zenner

Join Date:
Oct 2009
Location:
Burbank, CA
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

It actually works now!!

2 Jan 2010, 9:20 AM
#29
lovejonesboutique avatar

lovejonesboutique

New Zenner

Join Date:
Oct 2009
Location:
Georgia
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

This is so simple and easy...I love it. However, I cant figure out how to link an image embedded into this code to another page. How would I do that? Any help would be greatly appreciated.

Thanks

2 Jan 2010, 9:39 AM
#30
gpdmtr25 avatar

gpdmtr25

New Zenner

Join Date:
Oct 2009
Location:
Burbank, CA
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

I linked it an external site by
<a href="http://www.penturners.org" target="_blank">
I think you would just put your site page address in I.e. the page you want to link to.
I've done this several time connecting one page to another with a photo.

<a target="_blank" href="http://www.thecreativepencompany.com/index.php?main_page=page&id=11"> <img border="0" alt="Customer Satisfaction Logo" src="http://www.thecreativepencompany.com/includes/templates/custom/images/satisfaction-icon.jpg"/>

Hope this helps
Angela

3 Jan 2010, 7:57 PM
#31
lovejonesboutique avatar

lovejonesboutique

New Zenner

Join Date:
Oct 2009
Location:
Georgia
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

GPDMTR25:

I linked it an external site by
<a href="http://www.penturners.org" target="_blank">
I think you would just put your site page address in I.e. the page you want to link to.
I've done this several time connecting one page to another with a photo.

<a target="_blank" href="http://www.thecreativepencompany.com/index.php?main_page=page&id=11"> <img border="0" alt="Customer Satisfaction Logo" src="http://www.thecreativepencompany.com/includes/templates/custom/images/satisfaction-icon.jpg"/>

Hope this helps
Angela

Thanks...it worked perfectly.
Joann:clap:

3 Jan 2010, 8:19 PM
#32
gjh42 avatar

gjh42

Black Belt

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

Re: custom sidebox, i.e. perhaps for SSL or trust seal

If you are using an internal link (to the same site), use a relative URL, not an absolute one. This will be portable if you move your installation or have a test installation, and will avoid possible "non-secure link" errors on SSL pages.
Instead of```html
<a target="_blank" href="http://www.thecreativepencompany.com/index.php?main_page=page&id=11">
<img border="0" alt="Customer Satisfaction Logo" src="http://www.thecreativepencompany.com/includes/templates/custom/images/satisfaction-icon.jpg"/>

use```html
<a target="_blank" href="index.php?main_page=page&id=11">
<img border="0" alt="Customer Satisfaction Logo" src="includes/templates/custom/images/satisfaction-icon.jpg"/>
5 Jan 2010, 5:29 AM
#33
gpdmtr25 avatar

gpdmtr25

New Zenner

Join Date:
Oct 2009
Location:
Burbank, CA
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

THanks for the information. I'll try doing that and see if it still works. I'll also have to learn what relative URL and absolute URL are.
Angela

5 Jan 2010, 3:58 PM
#34
gjh42 avatar

gjh42

Black Belt

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

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Relative URL is added to whatever the Zen Cart base href is. The base will change between SSL and non-SSL pages, and will also be different if you have a test copy of your site set up elsewhere.

Absolute URL is the full http://www.yoursite.com/index.php?main_page=etc...