Page 31 of 40 FirstFirst ... 212930313233 ... LastLast
Results 301 to 310 of 393
  1. #301
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Smart Backgrounds support

    Either you have a foreground image for your logo, or background images. Switching background images will not hide the foreground image - the different background images will be there, covered by the foreground image.
    You can set the normal logo as a background image for #logo, so it will show when there is no special image.

    It looks like the logo is taking its height and width from pixel_trans.gif. This may mean that you have not defined height and width in /includes/languages/english/your_template/header.php.
    Last edited by gjh42; 10 Feb 2010 at 11:19 PM.

  2. #302
    Join Date
    Mar 2009
    Posts
    221
    Plugin Contributions
    1

    Default Re: Smart Backgrounds support

    Thanks for your time. I'll hack away at this some more and see if I can figure it out.

  3. #303
    Join Date
    Mar 2009
    Posts
    221
    Plugin Contributions
    1

    Default Re: Smart Backgrounds support

    OK. I've gone through this multiple times... Here is what I've got. Again, I just want the main website logo to change when going to specific categories.

    /custom_template/css/stylesheet_smartbg.php:
    Code:
    #logo {background-image: url(../images/smartbg.gif);}
    
    .smartBG_1 #logo {background-image: url(../images/smartbg_1.gif);}
    .smartBG_4 #logo {background-image: url(../images/smartbg_4.gif);}
    .smartBG_44 #logo {background-image: url(../images/smartbg_44.gif);}
    .smartBG_103 #logo {background-image: url(../images/smartbg_103.gif);}
    .smartBG_84 #logo {background-image: url(../images/smartbg_84.gif);}
    .smartBG_36 #logo {background-image: url(../images/smartbg_36.gif);}

    /includes/languages/english/custom_template/header.php (specified the width and height of each of the smartbg_ images):

    Code:
    define('HEADER_LOGO_WIDTH', '955');
    define('HEADER_LOGO_HEIGHT', '90');
    define('HEADER_LOGO_IMAGE', 'pixel_trans.gif');
    /includes/templates/custom_template/common/tpl_main_page.php:
    Code:
    <body id="<?php echo $body_id . 'Body'; ?>" class="smartBG<?php echo smart_backgrounds();?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
    The test images (smartbg_xx) have all been uploaded to /custom_template/images/


    The problem:
    There is no main website logo on homepage and there are no logos appearing when entering the specific categories.

    What have I missed?
    Last edited by Crunch; 11 Feb 2010 at 03:53 AM.

  4. #304
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Smart Backgrounds support

    I don't see anything that looks wrong in your post. I would need to see you r site to offer any more advice.

  5. #305
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

  6. #306
    Join Date
    Sep 2008
    Posts
    97
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Hi Glen,

    I was wondering if I could change the background for a specific Product ID (and not just its SubCategory)?

    Let's say my SubCategory ID is 10_36 and my product ID is 196, what would be the right way to call it? (if that's even possible).

    I tried what seemed the most logical (at least, to me):
    .smartBG_10_36_196 #navColumnOne {background-image: url(../images/smartBG_10_36_196.gif);}
    and
    .smartBG_10_36&products_id=196 #navColumnOne {background-image: url(../images/smartBG_10_36&products_id=196.gif);}

    No luck with those 2...

    Any advice?

    Thanks

    Damien

  7. #307
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Smart Backgrounds support

    Smart Backgrounds is not built to distinguish individual products. The first rule you show would not function for you in SBG, and the second one is not a valid stylesheet selector or URL.

    It would be easy to modify the function code to look for product images instead of or in addition to category images.
    You could also use a simple test in your tpl_main_page.php, something like
    PHP Code:
    <?php 
    $smart_image 
    smart_backgrounds();
    if (
    $current_page_base == 'product_info' and $_GET['products_id'] == '196'$smart_image '_p196';
    ?>

    <body id="<?php echo $body_id 'Body'?>" class="smartBG<?php echo $smart_image;?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'?>>
    This is hard-coded for one product; if you want it to dynamically check for product images, I will post the code for that.

    The CSS would be like
    Code:
    .smartBG_p196 #navColumnOne {background-image: url(../images/whatever.gif);}

  8. #308
    Join Date
    Sep 2008
    Posts
    97
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Glen,

    Thanks for your speedy reply.

    To have the code for a dynamic check of product images would be awesome!
    I do have several products I'd like to attribute a specific background to. That would be must faster than copy/paste your code and change the ID number for each product... plus, that would make more sense for future use.

    I cannot count the amount of times you have help me.
    Thanks,

    Damien

  9. #309
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Smart Backgrounds support

    OK, here's a multi-multi-stacking version. It first checks for an individual product image, then for a generic '_product_info' image, then for category images as before. Replace the entire content of smart_backgrounds_functions.php with this. Save the original file elsewhere first as a backup.
    PHP Code:
    <?php
    /**
     * @package templateSystem
     * @copyright Copyright 2010 Glenn Herbert
     * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * /includes/functions/extra_functions/smart_backgrounds_functions.php  gjh42  2010-02-10   test 2010-02-17
     * Smart Backgrounds   by Glenn Herbert (gjh42)
     *
     * Call this function from any file where page-dependent coding is desired.
     * $smart_image = smart_backgrounds();
     * Include string arguments if you want to use other than '.gif' images or look for other than 'bg' files.
     * $smart_image = smart_backgrounds('.jpg','sidebox'); //returns '_23' if smartsidebox_23.jpg exists
     * Use the value of $smart_image to set a classname, filename or other event management when a corresponding image file exists.
     */

    function smart_backgrounds($ext='.gif'$location='bg'){
      
    $smart_image '';
      if (
    $_GET['main_page'] == 'index' or $_GET['main_page'] == 'product_info') { 
        
    // _p and products_id  only if individual prod bg image exists, else  _product_info  only if page bg image exists, else  _ and cPath  only if individual cat bg image exists, else  _ and top cat id  only if top cat bg image exists
        
    $smart_image = ($_GET['main_page'] == 'product_info' and file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_p' $_GET['products_id'] . $ext))?'_p' $_GET['products_id']:(($_GET['main_page'] == 'product_info' and file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_product_info' $ext))?'_product_info':
                       (
    file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_' $_GET['cPath'] . $ext)?'_' $_GET['cPath']:(file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_' . (int)$_GET['cPath'] . $ext)?'_' . (int)$_GET['cPath']:'')));
      } elseif (
    $_GET['main_page'] == 'page') { // _page and ez-page id  only if ez-page id bg image exists, else  _page  only if general ez-page bg image exists
        
    $smart_image file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_page' $_GET['id'] . $ext)?'_page' $_GET['id']:(file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_page' $ext)?'_page':'');
      } else { 
    // _ and page base only if page bg image exists
        
    $smart_image file_exists(DIR_WS_TEMPLATE_IMAGES 'smart' $location '_' $_GET['main_page'] . $ext)?'_' $_GET['main_page']:''//if no images are found $smart_image will be blank
      
    }
      return 
    $smart_image;
    ?>
    Let me know how this works, and I will adjust if needed.

    Oh yes, name the images like smartbg_p123.gif or smartbg_product_info.gif.
    Last edited by gjh42; 17 Feb 2010 at 08:43 PM.

  10. #310
    Join Date
    Sep 2008
    Posts
    97
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Glenn,

    I wasn't expecting that much that fast! Thanks!

    I guess it's a great time to upgrade... I only have the 2.1.1 (No smart_backgrounds_functions.php in that version).
    I will get back to you as soon as the v.3.0.1 is in place and the mod added.

    Thanks again!

    Damien

 

 
Page 31 of 40 FirstFirst ... 212930313233 ... LastLast

Similar Threads

  1. Adding Image Map to header with Smart Backgrounds
    By cspan27 in forum Addon Templates
    Replies: 16
    Last Post: 25 Jul 2009, 01:14 AM
  2. smart backgrounds
    By Glendon in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 11 Sep 2008, 04:49 PM
  3. Backgrounds
    By v.kirk in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Jun 2006, 06:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg