Results 1 to 10 of 393

Hybrid View

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

    Default Re: Smart Backgrounds support

    If the navigation bar you are talking about is the one with manufacturer categories, that is #navCatTabsWrapper (even in your Template Monster template) and can be styled with
    Code:
    #navCatTabsWrapper {
        background: #aabbcc;
        padding: 0.1em;
        width: 100%
        }
    You will need to tweak the padding as it doesn't want to follow exactly the background strip you have for it, and it doesn't look like it is capable of expanding to the full page width due to the template structure.

    TM templates are usually much harder to customize the style of, since they have lots of extra nested divs, sometimes tables, and renamed standard elements, sometimes with standard distinction abilities removed.

    Since you have done so much since you first posted, it is hard to tell what some of your comments refer to.

  2. #2
    Join Date
    Jul 2009
    Location
    Prague, Czech Republic
    Posts
    530
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Quote Originally Posted by gjh42 View Post
    Since you have done so much since you first posted, it is hard to tell what some of your comments refer to.
    Sorry, yes, I realise that That's the trouble with the seven minute limit on editing sometimes


    Quote Originally Posted by gjh42 View Post
    TM templates are usually much harder to customize the style of, since they have lots of extra nested divs, sometimes tables, and renamed standard elements, sometimes with standard distinction abilities removed.
    Tell me about it LOL. I'll take a look at the navCatTabsWrapper padding later today when I get time



    Thanks for the reply Glenn, and it's a great little MOD btw

  3. #3
    Join Date
    Sep 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    I've read most of the thread, and managed to get the foreground image code working, to vary between different logo foreground images. I've tried several times to replace the current code that is in tpl_header.php to get images to work with subcategories, using the bg image code, modified for use with foreground images and with .jpg

    Base code (works, but no subcatagories)
    Code:
    if ($current_page_base == 'index' or $current_page_base == 'product_info') { //change filename to smartimg_ and top cat id only if cat image exists
      $smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartimg_' . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]) . '.jpg'))?'smartimg_' . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath] . '.jpg'):HEADER_LOGO_IMAGE;
    Attempted code (no images show)
    Code:
     if ($current_page_base == 'index' or $current_page_base == 'product_info') { //add _ and cPath to img filename only if individual cat img image exists, else add _ and top cat id to img filename only if top cat img image exists
      $smart_image = file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartimg_' . $_GET[cPath] . '.jpg')?'_' . $_GET[cPath]:(file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartimg_' . (int)$_GET[cPath] . '.jpg')?'_' . (int)$_GET[cPath]:'');
    Any help or ideas would be most appreciated.

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

    Default Re: Smart Backgrounds support

    It looks like you are using code from v2.0 or earlier. This has been improved even in the currently available v2.1.1 to allow indifidual subcategory control, and v3.0 radically changes the method of use to be much simpler and more flexible.

    With mod submissions and updates sometimes taking two months or more to be approved these days, I had forgotten that I had not actually submitted it yet, and the thread where I did attach the zip is obscure enough that only 33 people had downloaded from there. Since I have heard no questions from them about how to make it work, I will assume that they have not found any bugs, and proceed to submit the update. Until it is approved, I will move the attachment to this thread.
    Last edited by gjh42; 10 Feb 2010 at 08:59 AM.

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

    Default Re: Smart Backgrounds support

    For the case of foreground image switching, this from the v3.0 readme tells how to use it:

    ----------------------------------------------------------------------------------------------
    To switch Foreground images instead of Backgrounds:

    Call the smart_backgrounds() function from any file where page-dependent coding is desired.
    Include string arguments if you want to use other than '.gif' images or look for other than 'bg' files.


    <?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartsidebox' . smart_backgrounds('.jpg','sidebox') . '.jpg', 'Your alt text');?>

    will output

    <img src="http://yourdomain.com/includes/templates/your_template/images/smartsidebox_page5.jpg" alt="Your alt text">

    on ez-page id 5 if smartsidebox_page5.jpg exists. Combine this with an "if" statement

    $smart_image = smart_backgrounds('.jpg','sidebox');
    if ($smart_image == '_page5') {
    echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartsidebox' . $smart_image . '.jpg', 'Your alt text');
    }

    to show the content only on ez-page id 5 if smartsidebox_page5.jpg exists.

    if (substr_count($smart_image,'_page')) {
    echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartsidebox' . $smart_image . '.jpg', 'Your alt text');
    }

    will show the content on any ez-page if an appropriate smartsidebox_page.jpg file exists.
    Name and save images as described above.
    For foreground images, you do not need to make individual stylesheet rules.
    ----------------------------------------------------------------------------------------------

    You could use
    PHP Code:
    <?php echo zen_image(DIR_WS_TEMPLATE_IMAGES 'smartlogo' smart_backgrounds('.jpg','logo') . '.jpg''Your alt text');?>
    with images like smartlogo_13_27.jpg to give a custom logo for subcategory cPath 13_27.

  6. #6
    Join Date
    Sep 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Glenn,

    Thank you for the quick feedback. I'll check out the 3.0 code and make it work.

    cfs

  7. #7
    Join Date
    Sep 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Still having a bit of trouble.

    The images I am trying to vary are the logo images. Looking over the code in 3.0, I revised my branding section of tpl_header.php to include the following:

    Code:
    <!--bof-branding display-->
    
    <tr align="right">
    <td>
    
    
    <div id="lwrapper">
    
    <div id="logo">
    
    <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartimg' . smart_backgrounds('.jpg','img') . '.jpg', HEADER_ALT_TEXT, HEADER_LOGO_WIDTH, HEADER_LOGO_HEIGHT) . '</a>'; ?></div>
        
    <br class="clearBoth" />
    </div>
    
    </td>
    </tr>
    
    
    <!--eof-branding display-->
    It hangs up the site completely. Something is not working with

    smart_backgrounds('.jpg','img')

    I've got it working with the function removed from the code.

 

 

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