Announcement

Collapse
No announcement yet.

Using block if's or variables to modify list lengths

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

    Using block if's or variables to modify list lengths

    I have followed gabrielcrowe's great tutorials on blocks to add best seller lists.

    Thanks for the great info!

    Pages are of all different lengths however so I would like rather than using block ifs to limit the list to 6 best sellers to display the correct number for the length of the page.

    I have put the list in a table but the height of the cell is dependant on the ammount of content in teh cell to the left.

    Is there any way to list as many items as will fit in the cell rather than a fixed number?

    Thanks

    #2
    you would have to know the dimensions of the items before they are rendered (if i'm understanding you correctly).

    this means the answer will be no, i'm afraid. but isnt limiting the number enough?

    Comment


      #3
      Would overflow:hidden be a possible solution along with a fixed height?


      Bikster
      SellerDeck Designs and Responsive Themes

      Comment


        #4
        Hi,

        Limiting the number is not bad and far better than nothing but unfortunately I have some pages that are much longer than others and can't really start dividing up my products to make pages of an even length!

        I could make the product images a fixed height by using the thumbnails that I have manually created, I am not a fan of auto resizing generally as the quality and results are sometimes unexpected so I have manually created thumbnails for each item.

        jont could you expand on your suggestion at all?

        Thanks

        Comment


          #5
          Here's an thought. You can make a full-size list of Best Sellers but put it inside an area that we clip at page load time to be the same height as the main content. We also set this area to hide any overflow.

          Put an named DIV around your main display area
          e.g.

          <div id="mainarea">
          .
          MAIN CONTENT HERE
          .
          </div>

          Put another named DIV around your best seller area

          <div id="subarea" style="overflow:hidden">
          .
          BEST SELLERS HERE
          .
          </div>

          Then in the <body ...> tag amend

          Code:
          <body onload="<actinic:variable value="PreloadImages" name="OnLoadScript" />">
          to be

          Code:
          <body onload="document.getElementById('subarea').style.height=document.getElementById('mainarea').offsetHeight;<actinic:variable value="PreloadImages" name="OnLoadScript" />">
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Thanks everyone, I will do a bit of reading and have a play with the options you have suggested and see if I can get it to work.

            Comment


              #7
              Norman, you are a genius!

              That works like a charm, thanks so much. I don't suppose you know how to override actinic's in built maximum of 20 items in the best sellers list?

              At the moment all of the images are all different lengths: http://www.leonpaul.com/acatalog/catalogbody.html

              I have added thumbnail images for each product that are cropped so they are all 70 by 70 squares but while they work in my "other customers bought" section they don't in the bestsellers

              I am sure I am being thick but what do I need to do to this code

              Code:
              <actinic:block type="BestSellersList" >
              <actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3c%3d%207" >
              	<img src="<actinic:variable name="ProductImageFileName" />" width="100" alt="<actinic:variable name="ProductName" />" border="0" /><br>
              	<a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="ProductReference" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>">
              	<Actinic:Variable Name="ProductName"/>
              	</a><br>
              	<br>
              </actinic:block>
              </actinic:block>
              In order to substitute sorce = image file name for source = thumbnail?

              Code:
              <img src="<actinic:variable name="Thumbnail" />" <actinic:variable 
              
              name="ThumbnailSize" /> />
              Is what works in the best sellers but even that doesn't look like it should work!!

              Thanks,

              Alex

              Comment


                #8
                I don't suppose you know how to override actinic's in built maximum of 20 items in the best sellers list
                Afraid not. Anyone else?

                As for the Thumbnail. That variable seems only to work in the shopping cart when it should work anywhere a Product is defined. This is still a problem in V9. Tut tut Actinic!

                A simple solution would be to create your own Product level Variable MyThumb of type Filename. Allow it to be blank.

                Then store your thumbnail image filenames in there.

                Now you can have a bit of code like
                Code:
                	<actinic:block if="%3cactinic%3avariable%20name%3d%22MyThumb%22%20%2f%3e%20%21%3d%20%22%22" >
                		<img src="<actinic:variable name="MyThumb" />" alt="<actinic:variable name="ProductName" encoding="strip"/>" />
                	</actinic:block>
                There's also in article in the Advanced guide about automatically creating thumbnails from the main product image. However it would need a bit of new code to make them all the same size (by adding borders if required).
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Originally posted by NormanRouxel
                  Afraid not. Anyone else?
                  CD posted this is hardcoded into the program as 20 was deemed the optimum limit - any more would grind it to a considerable halt.


                  Bikster
                  SellerDeck Designs and Responsive Themes

                  Comment


                    #10
                    Very tasty Norman! I now have a perfectly resized thumb that is properly compressed so that it still looks sharp! Thanks!!

                    I am using a block if to define the number of products that display but for some reason when I change to this thumbnail rather than an automatically resized one I end up with a list of one product.

                    Can you use more than one block if in a block or is there a way to combine them?
                    My code now looks like this:

                    Code:
                    <actinic:block type="BestSellersList" >
                    <actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3c%3d%2010" >
                    <actinic:block if="%3cactinic%3avariable%20name%3d%22MyThumb%22%20%2f%3e%20%21%3d%20%22%22" >
                    	
                    	<img src="<actinic:variable name="MyThumb" />" alt="<actinic:variable name="ProductName" encoding="strip"/>" />
                    	<br>
                    	<a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="ProductReference" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>">
                    	<Actinic:Variable Name="ProductName"/>
                    	</a><br>
                    	<br>
                    	
                    </actinic:block>
                    </actinic:block>
                    </actinic:block>
                    Also; I have already linked all of the thumbnails in the general tab of each product, I can copy and paste these over to the new custom variable no problem but it will take a while for 3 sites and 2000 products on each. Would there be any code that can pull the data from the other variable or will this by nature rune into the problem that means actinic can't natively display thumbnails outside the cart.

                    Thanks!

                    Re long best sellers lists, it is my understanding that these are generated all in one hit from your database rather than on the server so surely it wouldn't be that much of a drain to have an extended list?

                    Comment


                      #11
                      Originally posted by alexrpaul
                      Re long best sellers lists, it is my understanding that these are generated all in one hit from your database rather than on the server so surely it wouldn't be that much of a drain to have an extended list?
                      Unfortunately, I believe each PAGE in Actinic is generated seperately, and if each page contains Best Sellers, then the HTML code generation for the Best Sellers list will be repeated for each page - as many times as you have pages with Best Sellers.

                      That's why I now recommend to clients, they only use Best Sellers on the Home page.
                      Bill
                      www.egyptianwonders.co.uk
                      Text directoryWorldwide Actinic(TM) shops
                      BC Ness Solutions Support services, custom software
                      Registered Microsoft™ Partner (ISV)
                      VoIP UK: 0131 208 0605
                      Located: Alexandria, EGYPT

                      Comment


                        #12
                        I have added the best sellers to the right of the page and normans work around for the thumbs wors great.

                        It seems that the New product list variable will also work but the alsoboughtlist variable will not work.

                        Does anyone know if it possible to get the alsoboughtlist to work outside the cart and if so can you point me in the right direction please?

                        Thanks

                        Comment


                          #13
                          Originally posted by alexrpaul
                          long best sellers lists, it is my understanding that these are generated all in one hit from your database rather than on the server so surely it wouldn't be that much of a drain to have an extended list?
                          There is a work around in the AUG to bring the list in as an include and keep page generation down to a minimum.

                          The also bought list works at product level as well as the cart level out of the box ... check your product layout for the AlsoBoughtList layout is being inserted


                          Bikster
                          SellerDeck Designs and Responsive Themes

                          Comment


                            #14
                            Originally posted by wjcampbe
                            only use Best Sellers on the Home page.
                            I tend to trim the list using block if's and include on all pages eg the "Whats Hot" at the bottom of the product page http://www.cheaplingerie4u.co.uk/aca...ack-Dolly.html (mild adult content)


                            Bikster
                            SellerDeck Designs and Responsive Themes

                            Comment


                              #15
                              Originally posted by jont
                              There is a work around in the AUG to bring the list in as an include and keep page generation down to a minimum.
                              Thanks, I will check it out!

                              Originally posted by jont
                              The also bought list works at product level as well as the cart level out of the box ... check your product layout for the AlsoBoughtList layout is being inserted
                              I think maybe I have not been very clear, I was hoping the also bought would be dependent on cart contents rather than page contents, is that still possible?

                              The only list type I can se that may be relevant is: "AlsoBoughtList" but according to the AUG this "lists the also boughts for the current product" what does it mean by current product? The product in the cart, the list of products in that section or a specific product? It sounds like it means a specific product but I don't understand how that product is determined...

                              Is the also boughts list in the cart only dependant on the last item added to cart?

                              Thanks so much for your help!

                              Alex

                              Comment

                              Working...
                              X