Announcement

Collapse
No announcement yet.

Thumbnail images in a Section page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Thumbnail images in a Section page

    Hi,

    In my Section layout, I have added this line of code between a 'Productlist' block:-

    <img src="<actinic:variable name="Thumbnail" />" <actinic:variable name="ThumbnailSize" /> /> <actinic:variable name="ProductName"> <actinic:variable name="PriceListRetail" /><br/>

    The idea is that where the Section has sub-sections, you get the name of the Sub-section appearing, and then underneath that a list of the products in that subsection, i.e.

    Sub-Section 1
    product 1
    product 2
    product 3
    Sub Section 2
    product 4
    product 5 etc.

    This bit of code works nicely, underneath the Sub-section name, I get the name of the product and its price information. However, I don't get the thumbnail image appearing, just a red cross before each product name line.

    I was wondering if anybody knew why this is?

    I have defined a thumbnail image for each product in Content | General | Thumbnail. When I preview the page, and look in the source code for the page, where the image should be, the HTML reads as follows:-

    <img src="" {100} />

    So obviously the value of the 'thumbnail' variable is not making it through to the final HTML. Can anybody tell me where I might be going wrong with the Thumbnail part of this?

    Many thanks

    #2
    That variable is for use in the Search Results. Use:
    Code:
    <img src="<actinic:variable name="ProductThumbnailImageFileName" />"
     width="<actinic:variable name="ProductThumbnailImageWidth" />"
     height="<actinic:variable name="ProductThumbnailImageHeight" />" />
    You might also want to put a blockif around this so the tag is only generated if ProductThumbnailImageFileName is not empty.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman that was just the help I needed. It's funny, but I looked through all the variables, and even tried a few in my code, but I missed that one. I had previously got as far as I had thanks to your help as well.

      I now have my thumbnails showing, and I've put them into a <TABLE> </TABLE> structure for extra neatness (one product per table row).

      Having got this far, I am now wondering whether I can put my thumbnails and product names in a 2-column table rather than the 1-column table I have currently.

      I was wondering: as 'productList' works through the products in a sub-section, is there a variable that keeps count of the products, or something like that, that I could use to put Product 1 on the left-hand side of Row 1 of a 2 column table, then Product 2 on the right-hand side of Row 1, then product 3 on the next Row 2, left; product 4 on Row 2, right; and so on, through 'productList'?

      Or maybe I could declare my own 'count' variable, and use that? Not sure how to do that though, nor how to increment it.

      Comment


        #4
        easiest way would be to scrap the table, set divs to a certain width to contain them, and float them all left. Then the first one would sit against the left edge, the second one would sit against the first, there wouldn't room for the third so it would drop down below the first two and sit against the left edge, the fourth one would sit against the third, ad inifinitum.

        look into divs and float. that's my advice!

        Comment

        Working...
        X