different thumbnailsize in product-list1

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hello,

Is it possible to have a different thumbnail size as set in configuration>globalsettings>...
In global settings it is 190px.

I tried this, but it didn't work:

.product-list1 .product-item .picture
{
  float: left;
  margin: 10px 0 10px 10px;
  width: 125px;
  height: 125px;
}


I want "products in lines 1" to have a thumbnail size of 125px.
I want "products in grid" to have a thumbnail size of 190px.

thx
13 years ago
You are just changing the size of the container in css with that code. The image will be rendered based on settings, irrespective of the css defined for the box. (unless you add overflow: hidden; but that will crop the image, so isn't correct.

The images are rendered and displayed based on a user control that is called from within ProductsInLines.ascx, called ProductBox1.ascx or ProductBox2.ascx

If you open ProductBox1.ascx.cs from /modules, you'll see a filed called ProductImageSize. This returns a setting called Media.Product.ThumbnailImageSize, and defines a default of 125.

So, to change the image size, you need to find the user control that actually renders the image (in this case ProductBox1.ascx), find the reference to the image size setting, then update that value in the admin settings (or add it if it isn't there).

HTH.
13 years ago
thx for you're reply, you helped me :)

I created a new row in NOP_Setting and gave it this values:

442 | Media.Product.ThumbnailImageSizL | 100 | test


In productsinline1 it says:

        <asp:ListView ID="lvCatalog" runat="server">
            <LayoutTemplate>
                <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
            </LayoutTemplate>
            <ItemTemplate>
                <div class="item-box">
                    <nopcommerce:productbox2 id="ctrlProductBox" product='<%# Container.DataItem %>'
                        runat="server" />
                </div>
            </ItemTemplate>
        </asp:ListView>


so I opend productbox2.aspx

    <div class="picture">
        <asp:HyperLink ID="hlImageLink" runat="server" />
    </div>


In the code behind off productbox2.ascx

hlImageLink.ImageUrl = PictureManager.GetPictureUrl(picture, this.ProductImageSize, true);


and this:

        public int ProductImageSize
        {
            get
            {
                if (ViewState["ProductImageSize"] == null)
                    return SettingManager.GetSettingValueInteger("Media.Product.ThumbnailImageSizL", 125);
                else
                    return (int)ViewState["ProductImageSize"];
            }
            set
            {
                ViewState["ProductImageSize"] = value;
            }
        }


What am i doing wrong? I need the other (Media.Product.ThumbnailImageSize) for view in grid. And maybe an admin can move it to development. because this is not css.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.