Announcement

Collapse
No announcement yet.

Blocks and attributes

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

    Blocks and attributes

    I am trying to show only the PRODUCTNAME if the product has an attribute and choice, but if there isn't an attribute and choice I want to show the PRODUCTREFERENCE as well as the PRODUCTNAME

    I have tried a block if on ATTRIBUTENAME etc but the page tells me I have coding errors. I cannot see the coding errors which is frustrating.

    Can someone please help with which variable should be in the block?

    <h2 class="yellowTX">
    <a name="<Actinic:Variable Name="EncodedProductAnchor"/>"></a>
    <Actinic:Variable Name="ProductName"/>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22AttributeName%22%20%2f%3e%20%3d%3d%20%22%22">
    - <actinic:variable name="ProductReference" />
    </actinic:block>
    </h2>

    Cheers

    Gilbo

    #2
    Try it on the attribute display label instead, see if that works.

    Comment


      #3
      Hi,

      Same outcome, coding errors!

      Comment


        #4
        Try using the AttributeCount variable to test if a product has attributes or not?
        Tracey

        Comment


          #5
          No Coding errors with attribute count == 0 or with it < 1 bu the the Productreference still shows

          ????Gilbo

          Comment


            #6
            AttributeName will only work within an Attribute List. And that negative condition is a problem. You'll need something like:
            Code:
            <actinic:block php="true">$noattributes = true;</actinic:block>
            <actinic:block type="AttributeList">
            	<actinic:block php="true">$noattributes = false;</actinic:block>
            </actinic:block>
            <actinic:block php="true">
            	if ( $noattributes ) echo '<actinic:variable encoding="perl" selectable="false" name="ProductReference" />';
            </actinic:block>
            Note that Attributes withing Components may be handled differently, so you may need to experiment there.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X