If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Sideboxes / Multiple Custom Sidebox Header Images?

Multiple Custom Sidebox Header Images?

Started by digruk on 24 May 2013, 6:10 PM · Views: 2,096

Results 1 to 9 of 9
24 May 2013, 6:10 PM
#1
digruk avatar

digruk

New Zenner

Join Date:
Oct 2011
Posts:
10
Plugin Contributions:
0

Post #1 by digruk

Built a site for a friend... Have a question on Sidebox Navigation header images. Hopefully I can explain this clearly enough:

ZC Version: 1.50
Site: http://www.armorcoin.com

On any of the products pages (where the sideboxes are active) I have the following left column navigation:

"Armor of God" (image: right_c_sb_bg.gif) - "Categories" Sidebox
Product 1
Product 2...

"Especially For" (image: right_sb_bg.gif) - tweaked "More Information" Sidebox
blah 1
blah 2...

Owner wants to add a 3rd navigation category with a unique image / font for the header:

"Prayer is Power" (image: right_sb_bg2.gif)
Product 1
Product 2...

I have tried created a custom sidebox as well as tried to just tweak an existing sidebox (e.g. whos_online) and while I am able to get the sidebox to show, I am getting the same header image as the "Especially For" (right_sb_bg.gif) showing. I have created a new CSS element for the 3rd category:

Armor of God Category:
h3.category_sidebox_header_right{
background: url("../images/right_c_sb_bg.gif") no-repeat top left;
padding: 0 0 0 4px;
height: 37px;

Especially For:
.sidebox-header-left h3 {
background: url("../images/right_sb_bg.gif") no-repeat top left;
height: 37px;

Prayer is Power:
.sidebox-header-left2 h3 {
background: url("../images/right_sb_bg2.gif") no-repeat top left;
padding: 0 0 0 4px;
height: 37px;

However, I cannot seem to locate the place to tell the new sidebox to use the right_sb_bg2.gif image. So my question after all that is what and where do I need to modify within the sidebox to tell it to use the header-left2 rather than the just the header-left image?

Clearly you can see, I am not much of a programmer (more of just a hack at it) so I am not sure what I am missing. It seems simple enough in theory, but I am a bit perplexed. Please let me know what other information you would need to point me in the right direction.

Thanks for all the help in advance!
Digruk

24 May 2013, 6:20 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

Instead of editing any of the sidebox php template files, you probably could have done it all with CSS using the ID tags instead of adding new classes.

Where is the "prayer is power" sidebox displayed? I don't see it on product pages or category pages.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 May 2013, 8:10 PM
#3
digruk avatar

digruk

New Zenner

Join Date:
Oct 2011
Posts:
10
Plugin Contributions:
0

Post #3 by digruk

Currently turned off... I didn't want it to just hang out looking goofy while I tried to figure it out.

Again, I am not proficient by any stretch of the imagination, if there is a better way to do it, I'd be happy to do things more efficiently. The only caveat to that is the owner is pretty particular with the design elements and he wants a particular font for the headings that wouldn't translate well on most PCs.

I'll turn on the whos_on sidebox so you can see what I am getting at.

Thanks!

24 May 2013, 8:18 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

digruk:

I cannot seem to locate the place to tell the new sidebox to use the right_sb_bg2.gif image.
... but the image isn't even on the server.

Missing: http://www.armorcoin.com/includes/templates/denim/images/right_sb_bg2.gif
Present: http://www.armorcoin.com/includes/templates/denim/images/right_sb_bg.gif
Present: http://www.armorcoin.com/includes/templates/denim/images/right_c_sb_bg.gif

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 May 2013, 8:22 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #5 by drbyte

Doesn't this target the same h3 element you wanted, without needing to add more classes to the PHP/HTML?

#whosonline h3 {background-image: ....}

... instead of ```
.sidebox-header-left2 h3{background ...}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 May 2013, 8:41 PM
#6
digruk avatar

digruk

New Zenner

Join Date:
Oct 2011
Posts:
10
Plugin Contributions:
0

Post #6 by digruk

Ha... guess it serves me right for trying to do this at 3 am in the morning. I had the image in the root images folder not in my template image folder. It is in the proper location now.

I will look at #whosonline h3 and give that a shot as well.

Thanks for being a sane point of view.

24 May 2013, 9:50 PM
#7
digruk avatar

digruk

New Zenner

Join Date:
Oct 2011
Posts:
10
Plugin Contributions:
0

Post #7 by digruk

DrByte:

Doesn't this target the same h3 element you wanted, without needing to add more classes to the PHP/HTML?

#whosonline h3 {background-image: ....}

> ... instead of ```
.sidebox-header-left2 h3{background ...}

Brilliant. Thank you! This is why I need to stick with my day job and stop thinking I can help out friends (I just don't know enough).

Thanks Doc! You've saved the day.

Much appreciated.

24 May 2013, 11:49 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #8 by drbyte

You can do similarly with your other sideboxes too. :)

That's the power in using #id notation instead of .class notation

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 May 2013, 3:02 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Post #9 by gjh42

There is also no need for the added heading div:```html

<div class="sidebox-header-left category_sidebox_header_left"><h3 class="leftBoxHeading category_sidebox_header_right" id="categoriesHeading">&nbsp</h3></div> ``` You can get the same effect with the stock code, merely commenting out the box title output (or replacing it with  ) if you want.```html <h3 class="leftBoxHeading" id="categoriesHeading">&nbsp</h3> `````` #categoriesHeading { background: url("../images/right_c_sb_bg.gif") no-repeat top left; padding: 0 0 0 4px; height: 37px; } ```