Forums / Templates, Stylesheets, Page Layout / Trouble changing sidebox title to an image

Trouble changing sidebox title to an image

Locked

Views: 3,778

Results 21 to 27 of 27
This thread is locked. New replies are disabled.
4 Feb 2008, 12:46 AM
#22
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

Thank you for aligning my titles! :smile:

I was looking at the english.php file and I don't see a place in it where I can give it the image for the title. I found the sidebox for new and featured items but I can't find the one for the center. Is there another file for this?

I looked at featured_products.php and I see several places where it says $title =
I'm not sure which one to change.

4 Feb 2008, 6:14 AM
#23
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

If you want to edit the php files yourself, here are the changes to make. These titles are considerably more complex than the sidebox titles.
You don't need to touch the defines; name your header title images centerboxhead-featured.gif, centerboxhead-new.gif, and centerboxhead-specials.gif and save in /includes/templates/your_template/buttons/english/.

In /includes/modules/your_template/featured_products.php, find

    if (isset($new_products_category_id) && $new_products_category_id !=0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id);
      $title = '<h2 class="centerBoxHeading">' .  TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '') . '</h2>';
    } else {
      $title = '<h2 class="centerBoxHeading">' .  TABLE_HEADING_FEATURED_PRODUCTS . '</h2>';
    }

and change to

    if (isset($new_products_category_id) && $new_products_category_id !=0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id); //image titles - box header image if file exists 2007-10-04
      $title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') : TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '')) . '</h2>';
    } else {
      $title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') : TABLE_HEADING_FEATURED_PRODUCTS) . '</h2>';
    }

In /includes/modules/your_template/new_products.php, find

    if (isset($new_products_category_id) && $new_products_category_id != 0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id); 
      $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '' ) . '</h2>';
    } else {
      $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h2>';
    }

and change to

    if (isset($new_products_category_id) && $new_products_category_id != 0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id); //image titles - box header image if file exists 2007-10-04
      $title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-new.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-new.gif') :  sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '' )) . '</h2>';
    } else {
      $title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-new.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-new.gif') :  sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'))) . '</h2>';
    }

In /includes/modules/your_template/specials_index.php, find

  if ($specials_index->RecordCount() > 0) { 
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
    $zc_show_specials = true;
  }

and change to

  if ($specials_index->RecordCount() > 0) { //image titles - box header image if file exists 2007-10-04
    $title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-specials.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-specials.gif') :  sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B'))) . '</h2>';
    $zc_show_specials = true;
  }
4 Feb 2008, 8:02 AM
#24
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

Perfect!! Thanks soooo much for all your help! :D

6 Feb 2008, 3:46 AM
#25
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

Sorry for bringing this thread back up but I have one more problem. I just activated my ezpages sidebox and I can't figure out how to change that title to an image. I can't find it in my english.php file. How would I go about changing that one?

6 Feb 2008, 9:03 AM
#26
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

Ya know, I have this urge to put up a "if you lived here, you'd be home by now" sign... :) If you were using Image Titles for the sideboxes, all you would have to do is save the file named boxhead-ezpages.gif in /your_template/buttons/english/, and the header would appear. Since I developed the universal code, I don't need to find where the individual files are to edit for the tutorial method.

Anyhoo, try searching with the Developers Toolkit for BOX_HEADING_EZPAGES, and you should find the define statement with the file and line number where it is located.

6 Feb 2008, 11:37 PM
#27
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

I didn't know what the developer toolkit did until now. That would have been useful a few times lol! Anyway, I found it and the title works now, yay! Thanks so much for your help!

Sorry for asking so many questions. I've never set up a Zen Cart before. I don't mean to be a pest. And I really do appreciate all of your help! I'd be pretty screwed without this forum and everyone who's helped me. But my store is pretty close to done now as far as customization goes so hopefully I won't have too many more questions :smile: