Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Custom Image Width/Height

    Hi,

    I want to have my featured product images to be of a certain size (say 100 x 100) everywhere except, so how do I have my custom image widths?

    Feature image currently uses "IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT"

    how do I change that?

    Thanks.
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

  2. #2
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Custom Image Width/Height

    What I'm trying to do is display a large image (for featured products) on homepage, but normal sized on the rest of the pages.
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

  3. #3
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Custom Image Width/Height

    Still stuck with this, I would appreciate any help.

    How do I set custom width/height on select locations. Like for example, can I replace "IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT" with "320px, 220px"? (Tried that already, with no luck.)
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

  4. #4
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Custom Image Width/Height

    no idea, anyone?

    Thanks
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

  5. #5
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Custom Image Width/Height

    Still struggling with this. I see there's something related to image dimensions in includes\functions\extra_functions\functions_bmz_image_handler.php:

    Code:
    $ihConf['small']['width']       = SMALL_IMAGE_WIDTH;
    $ihConf['small']['height']      = SMALL_IMAGE_HEIGHT;
    $ihConf['small']['filetype']     = defined('SMALL_IMAGE_FILETYPE') ? SMALL_IMAGE_FILETYPE : 'no_change';
    $ihConf['small']['bg']          = defined('SMALL_IMAGE_BACKGROUND') ? SMALL_IMAGE_BACKGROUND : 'transparent 255:255:255';
    $ihConf['small']['quality']     = defined('SMALL_IMAGE_QUALITY') ? intval(SMALL_IMAGE_QUALITY) : 85;
    $ihConf['small']['watermark']   = defined('WATERMARK_SMALL_IMAGES') ? (WATERMARK_SMALL_IMAGES == 'yes') : false;
    $ihConf['small']['zoom']        = defined('ZOOM_SMALL_IMAGES') ? (ZOOM_SMALL_IMAGES == 'yes') : true;
    $ihConf['small']['hotzone']     = defined('SMALL_IMAGE_HOTZONE') ? (SMALL_IMAGE_HOTZONE == 'yes') : false;
    ..but I have absolutely no clue how to modify/add to that. I want to define custom image sizes.

    Thanks
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

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

    Default Re: Custom Image Width/Height

    You would have to modify the file that outputs the featured products with an alternate:

    if ($this_is_home_page) {
    larger image sizing code
    } else {
    original image code
    }

    Image Handler may make this more complicated; I don't know if it affects these images at display time.

  7. #7
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Custom Image Width/Height

    That would be the second step I think. But first, I need t odefine my own size, for example:

    Change:
    Code:
    <a href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . (int)$xsell_query->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $xsell_query->fields['products_image'], $xsell_query->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>
    To:
    Code:
    <a href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . (int)$xsell_query->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $xsell_query->fields['products_image'], $xsell_query->fields['products_name'], MYOWN1_IMAGE_WIDTH, MYOWN1_IMAGE_HEIGHT) . '</a>
    ..and be able to define a custom width/height to MYOWN1. Get me?

    Thanks!
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

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

    Default Re: Custom Image Width/Height

    That would be the "right" way to do it, adding an extra_definitions file with your constants defined, and then call them in some modified code. The easier way would be to put your desired h & w right in the code, in your custom template version of the file. It's your call.

  9. #9
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Custom Image Width/Height

    Quote Originally Posted by gjh42 View Post
    That would be the "right" way to do it, adding an extra_definitions file with your constants defined, and then call them in some modified code. The easier way would be to put your desired h & w right in the code, in your custom template version of the file. It's your call.

    Right, but since I only have very basic PHP knowledge, I'm not sure how would I achieve the result using any of those two methods.

    I would appreciated any help here.
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

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

    Default Re: Custom Image Width/Height

    You can do your alternate image sizing in /includes/modules/your_template/featured_products.php.
    Find this section:
    PHP Code:
      while (!$featured_products->EOF) {

        
    $products_price zen_get_products_display_price($featured_products->fields['products_id']);

        
    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' ' ' 'style="width:' $col_width '%;"',
        
    'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' $featured_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $featured_products->fields['products_image'], $featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTHIMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' $featured_products->fields['products_id']) . '">' $featured_products->fields['products_name'] . '</a><br />' $products_price);

        
    $col ++; 
    and add a version of the if test above to get this:
    PHP Code:
      while (!$featured_products->EOF) {

        
    $products_price zen_get_products_display_price($featured_products->fields['products_id']);
        if (
    $this_is_home_page) {
          
    $image_featured_myown1_width 320;
          
    $image_featured_myown1_height 220;
        } else {
          
    $image_featured_myown1_width IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH;
          
    $image_featured_myown1_height IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT;
        }
        
    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' ' ' 'style="width:' $col_width '%;"',
        
    'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' $featured_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $featured_products->fields['products_image'], $featured_products->fields['products_name'], $image_featured_myown1_width$image_featured_myown1_height) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' $featured_products->fields['products_id']) . '">' $featured_products->fields['products_name'] . '</a><br />' $products_price);

        
    $col ++; 

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 ZX Slide Show Image Width and Height
    By jodean in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jun 2015, 03:21 PM
  2. Replies: 1
    Last Post: 16 Aug 2011, 08:30 AM
  3. Product Listing - Image width & height issue
    By KismetDesign in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Sep 2009, 09:52 PM
  4. Get medium image height and width
    By noisebug in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Feb 2008, 06:58 AM
  5. Small Image Height and Width
    By TurtleDove in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Jun 2006, 08:22 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