Announcement

Collapse
No announcement yet.

Trouble with List Blocks

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

    Trouble with List Blocks

    After reading through Gabes Block tutorials and 2 days of pulling my hair out its time to turn to help.

    I am using the following code adapted from Tutorial 5

    Code:
    <div>
    <actinic:block type="EntireSectionList" >
    <actinic:block type="ProductList" >
    	<actinic:block if="%3cactinic%3avariable%20name%3d%22GiftSection%22%20%2f%3e%20%3d%3d%20%22Jewellery%22" >
    			<img src="<actinic:variable name="ProductImageFileName" />" width="120" alt="<actinic:variable name="ProductName" />" border="0" />
    
    	</actinic:block>
    </actinic:block>	
    </actinic:block>
    </div>
    GiftSection is a custom variable set as a list of choices. I have several products with this set as 'Jewellery' to make them show in the list.

    This works fine except I get an empty 'entry' at the beginining and end.
    (This is taken from viewing the source in IE)

    Code:
    <img src="" width="120" alt="" border="0" />
    <img src="SHE0027L.jpg" width="120" alt="Silver Earrings 1" border="0" />
    <img src="SHE0027L.jpg" width="120" alt="Silver Earrings 2" border="0" />
    <img src="SHE0027L.jpg" width="120" alt="Silver Earrings 3" border="0" />
    <img src="SHP0002L.JPG" width="120" alt="Silver Pendant 2" border="0" />
    <img src="" width="120" alt="" border="0" />
    Any idea what I am doing wrong?

    The site is not published but I could publish it if it helps
    Unusual Silver Jewellery
    Giftmill - Unusual Gifts
    Crystal Healing Jewellery
    Steampunk Jewellery

    #2
    Fragments appear in the products list. Do you have 2 on the page in question?
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Try
      Code:
      <actinic:block type="EntireSectionList" >
      	<actinic:block type="ProductList" >
      		<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductName%22%20%2f%3e%20%21%3d%20%27%27" >
      			<actinic:block if="%3cactinic%3avariable%20name%3d%22GiftSection%22%20%2f%3e%20%3d%3d%20%22Jewellery%22" >
      				<img src="<actinic:variable name="ProductImageFileName" />" width="120" alt="<actinic:variable name="ProductName" />" border="0" />
      			</actinic:block>
      		</actinic:block>
      	</actinic:block>	
      </actinic:block>
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Well I wouldn't have thought of that in a million years!

        There are two fragments in a different section of the site, when I deleted them everything works as expected.

        Is it possible to change the code so it ignores fragments or will I have to refrain from using fragments anywhere on the site
        Unusual Silver Jewellery
        Giftmill - Unusual Gifts
        Crystal Healing Jewellery
        Steampunk Jewellery

        Comment


          #5
          See my post above. If it's a fragment then the ProductName will be blank and we test for that.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            You never cease to amaze me Norman.
            Not only have you given me a solution to just about every problem I have ever posted about but now you answer my question 20 minutes before I asked it!!!

            The new code works a treat.

            Many many thanks
            Unusual Silver Jewellery
            Giftmill - Unusual Gifts
            Crystal Healing Jewellery
            Steampunk Jewellery

            Comment

            Working...
            X