Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Problem with sidebox image

Problem with sidebox image

Views: 2,054

Results 1 to 20 of 25
31 Aug 2011, 7:50 PM
#1
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Problem with sidebox image

I am lost.

I need to add an image into the sidebox with a header over it and some text under it. The image is a book (like eBooks)

For this I used Banner Box 2
I defined the header for it in English.php - That is ok.
Now I cannot find where to change the image source, change title or change the alt. Right now it references a redirect to zen cart

<a target="_blank" href="http://mysite/catalog/index.php?main_page=redirect&action=banner&goto=2"> <img width="125" height="38" title=" Zen Cart the art of e-commerce " alt="Zen Cart the art of e-commerce" src="images/banners/125zen_logo.gif">

Searches only recover to possible places, banner_box2.php and tpl_banner_box2.php. I tried both of those and I think I have looked in every other folder but php is all gobbledygook for me.

Can someone please help me.

thank you
Ivanna

31 Aug 2011, 8:38 PM
#2
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

I looked at tpl_banner_box2.php again and I think I must change a "$content" line

$content = '';
// if no active banner in the specified banner group then the box will not show
if ($banner = zen_banner_exists('dynamic', $banner_box_group)) {
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
$content .= zen_display_banner('static', $banner);
$content .= '</div>';

But I am not sure which line or what I must change it to.

thank you
Ivanna

31 Aug 2011, 8:46 PM
#3
stevesh avatar

stevesh

Black Belt

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

Re: Problem with sidebox image

I may not understand, but in Admin - Tools - Banner Manager, there is a box in each banner setup page where you can enter your HTML for that banner.

I would use the Blank Sidebox mod for what you're describing, though.

31 Aug 2011, 9:30 PM
#4
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

Hi Steve,
I was not sure if I am doing it correct, so I look everywhere before asking for help.
I looked at the Banner manager but was not sure if this was correct. I thought this is only for zen cart banners.
Also, I looked in Tools/layout box controller but I do not see Blank Sidebox. I am using Barebones template.

thank you
Ivanna

31 Aug 2011, 9:36 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

Blank Sidebox is a mod you can download from Free Addons at the top of this page. It is ideal for new content like you want.

Install it and modify / add content as you like.

1 Sep 2011, 8:43 PM
#6
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

Everything on my site disappeared

I have a problem with Blank Sidebox Mod even so I follow all the instructions.

I think the problem is because when I make changes in Crimson Editor, I did not save with an extension name
I did not know this until after I upload everything to the server. :oops:

Even so I remove the bad files and replace with proper files with extension .php, the Admin still says "Missing" and in two instant show Box File Name of files without the extension.

I delete these files with Filezilla and also go into cPanel to search and delete them.
A file search in cPanel now only shows correct files in correct places but Admin does not update.

One box file name shows Red. The file name is sideboxes/barebones/ebook_sidebox.php - sideboxes/barebones/ is Red. When I turn this file on, I lose everything. When I turn it off, everything comes back.

There are two sideboxes/ebook_sidebox that have red highlight and the words MISSING - these files should be gone.

I have also loaded from last nights backup and re-added the sidebox files, but it is still the same.

(I only do this today so the backup is clean)

I think Admin should update when I have deleted the files. It still shows the old files.

The correct files should be:
includes/languages/english/extra_definitions/barebones/ebook_sidebox_defines.php
includes/modules/sideboxes/barebones/ebook_sidebox.php
includes/templates/barebones/sideboxes/tpl_ebook_sidebox.php

How can I update Admin to show me the correct files?

thank you
Ivanna

1 Sep 2011, 9:10 PM
#7
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

I have found how to delete the MISSING files but I still have the sideboxes/barebones/ebook_sidebox.php as RED
When I turn this file on everything disappears.

I think it must be something in the path that is wrong (because it is red)

The instruction say use this path
includes/modules/sideboxes/YOUR_TEMPLATE_NAME/blank_sidebox.php

I use
includes/modules/sideboxes/barebones/ebook_sidebox.php

thank you
Ivanna

2 Sep 2011, 1:20 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

The sideboxes/barebones/ebook_sidebox.php is meant to be red, because it is a custom template file and not a default file. That is not related to the problem.

2 Sep 2011, 2:27 PM
#9
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

Thank you gjh42,

the red words make sense, I understand that now. what I do not understand is what I do wrong!

In all three files, I change each instant of blank_sidebox to ebook_sidebox and **BLANK_SIDEBOX to EBOOK_SIDEBOX
**
I have put original code beside my changes and check it word for word and do not see a difference (only ebook for blank and EBOOK for BLANK)

I have checked the path for each file with the instruction they are:

includes/languages/english/extra_definitions/barebones/ebook_sidebox_defines.php
includes/modules/sideboxes/barebones/ebook_sidebox.php
includes/templates/barebones/sideboxes/tpl_ebook_sidebox.php

When I turn it ON in Admin, I lose everything except the page header.
I see I have not set a sort order, so I give it sort order of 2. Now I see the sidebox that is set to sort 1, but I do not see my new sidebox or any other side boxes or the main page area or footer.

Now I make sort to 10.
Now I see all sideboxes except mine and I still do not see the main page area or footer.

From my troubleshooting, I see one of the files is stopping everything else on the page from working but I do not understand PHP very well. I have looked at all the code and what I make out of the code is this:

ebook_sidebox_defines.php, I can define any words within ' ' this is title and text
tpl_ebook_sidebox.php, I can make changes within <p> tags line 19 & 20
ebook_sidebox.php calls /tpl_blank_sidebox.php and pulls $title from ebook_sidebox_defines.php

So if I understand this correctly, then I do not know what is wrong. The only thing I think of is the path but I have checked it 1000 times already. (well, not 1000 but many times :smile:)

Your help is very appreciated.

thank you
Ivanna

20 Sep 2011, 4:43 PM
#10
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

I downloaded this blank_sidebox and configured it as (I think) the instructions but I do not see it in the sidebar. I changed the name from "blank" to "ebook" and changed all instants of those words.

Problems encountered are loss of all website that comes after this file.

For instance, when I go into Admin/Tools/Layout Boxes Controller I make these settings:
Left/Right column Status = On
Left or Right Column = Left
Left/Right column Sort Order = 15
Single Column Sort Order = 0
Single Column Status = Off

This is the same configuration for all my side boxes, the only difference is Sort Order.

When the sort order for ebook_sidebox is 0, I can only see the header section of the webpage, no more.
When I change the sort order, the boxes with a lower sort number will show but not the boxes with a higher number or the content page or the footer. It seems that no more php files are including. (is that right?)
When I set to the highest sort number (15) everything on the sidebar shows but no more.

When I turn the Left/Right column Status = Off, I can see all the webpage.

I changed the file names and put them in the correct paths as instructed. I do not know if I have read this right and perhaps the path is not the correct one. The paths are:

includes/languages/english/extra_definitions/barebones/ebook_sidebox_defines.php
includes/modules/sideboxes/barebones/ebook_sidebox.php
includes/templates/barebones/sideboxes/tpl_ebook_sidebox.php

Can somebody please tell me if these are correct paths?

I can show the edits to these pages also if it will be helpful.

thank you
Ivanna

20 Sep 2011, 7:29 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

Those look like appropriate filepaths. Seeing your edits to the files would let us figure out what is wrong.

20 Sep 2011, 7:49 PM
#12
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

Thank you.
These are the files.

includes/languages/english/extra_definitions/barebones/ebook_sidebox_defines.php

line 12 & 13

define('BOX_HEADING_EBOOK_SIDEBOX', 'The Gardeners Guide');
define('TEXT_EBOOK_SIDEBOX', 'Get your copy of The Gardeners Guide to Growing Hardy perennial Orchids.');

====================================================

includes/modules/sideboxes/barebones/ebook_sidebox.php

lines 13 - 20

$show_ebook_sidebox = true;

if ($show_ebook_sidebox == true) {
require($template->get_template_dir('tpl_ebook_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sidebox'). '/tpl_ebook_sidebox.php');
$title = BOX_HEADING_EBOOK_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}

====================================================

includes/templates/barebones/sideboxes/tpl_ebook_sidebox.php

Lines 12 - 26

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

// Replace the text and HTML tags between the apostophes on lines 19 and 20.
// Use as many or as few lines using this model as you need for your custom content.
// 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.
// If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
$content .= '<p>'TEXT_EBOOK_SIDEBOX'</p>';
/* $content .= '<p>' <img width="175" height="211" title=" The Gardeners Guide " alt="the gardeners guide to growing hardy perennial orchids" src="/images/woc-book-cover.jpg"> '</p>'; */
$content .= '<p>Get your copy of The Gardeners Guide to Growing Hardy Perennial Orchids </p>';

$content .= '</div>';
?>

/* <a target="_blank" href="../catalog/images/woc-book-cover.jpg"> */

======================================================

I hope you will find the problem :smile:

thank you
Ivanna

20 Sep 2011, 9:57 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

$content .= '</div>';
?>

/ <a target="_blank" href="../catalog/images/woc-book-cover.jpg"> /

You are using PHP comment tags, but the PHP has ended here. You need to use HTML comment tags <!-- -->

20 Sep 2011, 10:51 PM
#14
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

I have removed all of these tags /* */ but still the problem persists. All data that comes before the sort number is ok but all other data is gone.

$content .= '<p>'TEXT_EBOOK_SIDEBOX'</p>';
$content .= '<p>' <img width="175" height="211" title=" The Gardeners Guide " alt="the gardeners guide to growing hardy perennial orchids" src="/images/woc-book-cover.jpg"> '</p>';
$content .= '<p>Get your copy of The Gardeners Guide to Growing Hardy Perennial Orchids </p>';

$content .= '</div>';
?>

I only have four column boxes

sideboxes/categories.php sort = 10
sideboxes/barebones/ebook_sidebox.php sort = 14
sideboxes/barebones/ebook_sidebox.php sort = 50
sideboxes/more_information.php sort = 200

When sideboxes/barebones/ebook_sidebox.php does not work, I try to use sideboxes/banner_box2.php (sort = 14) as another option and I can see it.

What more information can I give you?

thank you
Ivanna

23 Sep 2011, 12:36 AM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

sideboxes/barebones/ebook_sidebox.php sort = 14
sideboxes/barebones/ebook_sidebox.php sort = 50

How do you have the same sidebox file listed twice? Something related to this is quite possibly the cause of your problem.

23 Sep 2011, 12:09 PM
#16
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

I am sorry, that is a typographic mistake. I have this:

sideboxes/categories.php...............................ON LEFT 10 10 ON
sideboxes/barebones/ebook_sidebox.php.....OFF LEFT 14 14 ON
sideboxes/banner_box2.php........................ON LEFT 15 15 ON
sideboxes/information.php..........................ON LEFT 50 40 ON
sideboxes/more_information.php.................ON LEFT 200 200 ON

Please notice that ebook_sidebox.php is off in this instant. When it is on, everything with bigger numbers is lost.

My other option is to use banner_box2.php (which I can see). The reason I do not use this is because I am advised blank_sidebox is a better option. Also because I cannot find where to change the file to change path and attributes for the banner image.

thank you for helping me
Ivanna

23 Sep 2011, 3:23 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

$content .= '<p>'TEXT_EBOOK_SIDEBOX'</p>';
/* $content .= '<p>' <img width="175" height="211" title=" The Gardeners Guide " alt="the gardeners guide to growing hardy perennial orchids" src="/images/woc-book-cover.jpg"> '</p>'; */
```The problem was very subtle, nothing more than dots . and quotes ' missing or extra.
Both the short "constant" line and the commented-out long line are incorrect. It needs to be ```php
$content .= '<p>' . TEXT_EBOOK_SIDEBOX . '</p>';
/* $content .= '<p> <img width="175" height="211" title=" The Gardeners Guide " alt="the gardeners guide to growing hardy perennial orchids" src="/images/woc-book-cover.jpg"> </p>'; */
23 Sep 2011, 5:42 PM
#18
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

Thank you g,

Again, when I turn it on, everything disappears.

I copied the code to lines 19 & 20.
Line 19 was my fault. I removed the . because I think it is only text inside the <p> tags. I did not know it is code.
On line 19 you write '<p>' but on line 20 you write '<p> is the second ' not necessary in this instant?
On line 20, does it really matter at all because it is commented out?

I think I must download blank_sidebox one last time and start it all again.

I cannot think of anything else to do.

thank you
Ivanna

23 Sep 2011, 5:54 PM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: Problem with sidebox image

Line 20 does not matter as long as it is commented out, but this case has straight HTML output between the <p> tags. Line 19 has a PHP constant holding the HTML output value.

The define file is not the problem, because everything in /extra_definitions/ is loaded no matter whether the sidebox is on or off. It might help to post your entire module and template files. Use ```
[php] and [/php]

23 Sep 2011, 7:36 PM
#20
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Problem with sidebox image

thank you again g,

includes/templates/barebones/sideboxes/tpl_ebook_sidebox.php

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

  // Replace the text and HTML tags between the apostophes on lines 19 and 20.
  // Use as many or as few lines using this model as you need for your custom content.
  // 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.
  // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
  $content .= '<p>' . TEXT_EBOOK_SIDEBOX . '</p>';
/* $content .= '<p> <img width="175" height="211" title=" The Gardeners Guide " alt="the gardeners guide to growing hardy perennial orchids" src="/images/woc-book-cover.jpg"> </p>'; */
  $content .= '<p>Get your copy of The Gardeners Guide to Growing Hardy Perennial Orchids </p>';

  $content .= '</div>';
?>

includes/languages/english/extra_definitions/barebones/ebook_sidebox_defines.php

<?php
/**
 * blank sidebox definitions - text for inclusion in a new blank sidebox
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

define('BOX_HEADING_EBOOK_SIDEBOX', 'The Gardeners Guide');
define('TEXT_EBOOK_SIDEBOX', 'Get your copy of The Gardeners Guide to Growing Hardy perennial Orchids.');

?>

includes/modules/sideboxes/barebones/ebook_sidebox.php

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  // test if box should display
  $show_ebook_sidebox = true;

  if ($show_ebook_sidebox == true) {
      require($template->get_template_dir('tpl_ebook_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sidebox'). '/tpl_ebook_sidebox.php');
      $title =  BOX_HEADING_EBOOK_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

thank you
Ivanna