Announcement

Collapse
No announcement yet.

what "block if" statement should I use?

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

    what "block if" statement should I use?

    I want to block some code if the component doesn't have an attribute list within it.
    I've had a couple of attempts but I'm either getting it to block on all components or showing on all components so I'm obvoiusly not coming up with the correct statement.

    I am tring to make the change within the component layout.

    can anyone help me with a a statement which work work?

    Regards
    Bangers
    Boxhedge New Media Design
    Design and development solutions for SME's.
    Tel: 0118 966 2786
    Examples of work can be found at http://www.boxhedge.com

    #2
    Have you tried

    Code:
    <actinic:variable name="AttributeCount" /> >= "1"
    or whatever

    Comment


      #3
      bentleybloke,
      Thankks for the reply.
      Yes I have tried it and it doesn't output code for either components with or without an attributelist. Probably worth stating that on the same product there are compontents which do have an attribute list.
      Here's my code:
      <div id="selections">
      <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentDisplayLabel%22%20%2f%3e%20%21%3d%20%22%22" >
      <span class="title"><Actinic:Variable Name="ComponentDisplayLabel"/></span>
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentDisplayLabel%22%20%2f%3e%20%21%3d%20%22%22" >
      <span class="sub"><actinic:variable name="BoxhedgeSubComponentMessage" /><br /></span>
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22AttributeCount%22%20%2f%3e%20%3e%3d%20%221%22" >
      <div class="checkbox">
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentCheckboxShown%22%20%2f%3e" >
      <input type="checkbox" name="<Actinic:Variable Name="UIWidgetName"/>" <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e">checked="checked"</actinic:block> />
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentHiddenFieldIncluded%22%20%2f%3e" >
      <input type="hidden" name="<Actinic:Variable Name="UIWidgetName"/>" value="on" />
      </actinic:block>
      <label for="#" class="subprice"><Actinic:PRICE_EXPLANATION PROD_REF="<actinic:variable Name="ProductID" />" COMPONENTID=<actinic:variable name="ComponentIndex" />><actinic:variable name="ComponentRetailCustomerMessage" /></Actinic:PRICE_EXPLANATION></label>
      <span class="subpriceinfo"><actinic:variable name="BoxhedgeComponentSubPriceMessage" /></span>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22AttributeCount%22%20%2f%3e%20%3e%3d%20%221%22" >
      </div>
      </actinic:block>
      <actinic:block if="%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%3d%3d%200%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3c%20%3cactinic%3avariable%20name%3d%22ComponentCount%22%20%2f%3e%29" >
      <actinic:variable name="ComponentAttributeList" />
      </actinic:block>
      <actinic:block if="%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%21%3d%200%29%20AND%0d%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22ComponentCount%22%20%2f%3e%29">
      <actinic:variable name="AttributeList" />
      </actinic:block>
      </div>
      Please ingore my custom variables,
      <actinic:block if="%3cactinic%3avariable%20name%3d%22AttributeCount%22%20%2f%3e%20%3e%3d%20%221%22" >
      <div class="checkbox">
      </actinic:block>
      Is the important bit. + same statements on closing div tag

      Any more help appreciated
      Boxhedge New Media Design
      Design and development solutions for SME's.
      Tel: 0118 966 2786
      Examples of work can be found at http://www.boxhedge.com

      Comment


        #4
        One thing I've done in the past is move any code which is conditional on a list appearing, into the 'Start of List' and 'End of List' fields in the list - so the list builds the whole thing - including all the code around it.

        Then any code you want to appear when there is no list, you can put that in the 'Empty List' field.

        Comment


          #5
          I don't think that wil work here.

          tags that wrap around my lists also have to be present on the single checkbox type compontnent.

          What I need is: when it is a single choice compontent which uses a single checkbox is used, I need to wrap a div tag around the checkbox and price explantions etc etc but not when there is a list of radio buttons or a drap down box.

          regards
          Lee
          Boxhedge New Media Design
          Design and development solutions for SME's.
          Tel: 0118 966 2786
          Examples of work can be found at http://www.boxhedge.com

          Comment


            #6
            What I'm suggesting is that you put
            Code:
            <div class="checkbox">
            
            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentCheckboxShown%22%20%2f%3e" >
            <input type="checkbox" name="<Actinic:Variable Name="UIWidgetName"/>" <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e">checked="checked"</actinic:block> />
            </actinic:block>
            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentHiddenFieldIncluded%22%20%2f%3e" >
            <input type="hidden" name="<Actinic:Variable Name="UIWidgetName"/>" value="on" />
            </actinic:block>
            <label for="#" class="subprice"><Actinic:PRICE_EXPLANATION PROD_REF="<actinic:variable Name="ProductID" />" COMPONENTID=<actinic:variable name="ComponentIndex" />><actinic:variable name="ComponentRetailCustomerMessage" /></Actinic:PRICE_EXPLANATION></label>
            <span class="subpriceinfo"><actinic:variable name="BoxhedgeComponentSubPriceMessage" /></span>
            
            </div>
            into the 'Empty List' field and put
            Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentCheckboxShown%22%20%2f%3e" >
            <input type="checkbox" name="<Actinic:Variable Name="UIWidgetName"/>" <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e">checked="checked"</actinic:block> />
            </actinic:block>
            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentHiddenFieldIncluded%22%20%2f%3e" >
            <input type="hidden" name="<Actinic:Variable Name="UIWidgetName"/>" value="on" />
            </actinic:block>
            <label for="#" class="subprice"><Actinic:PRICE_EXPLANATION PROD_REF="<actinic:variable Name="ProductID" />" COMPONENTID=<actinic:variable name="ComponentIndex" />><actinic:variable name="ComponentRetailCustomerMessage" /></Actinic:PRICE_EXPLANATION></label>
            <span class="subpriceinfo"><actinic:variable name="BoxhedgeComponentSubPriceMessage" /></span>
            into the 'Start of List' field of the Component Attribute List.

            Comment


              #7
              Well that works perfectly for a lucky guess!
              Either that or you might something about how this product works....
              Thanks again Chris.

              Very good lateral thinking

              Cheers
              Bangers
              Boxhedge New Media Design
              Design and development solutions for SME's.
              Tel: 0118 966 2786
              Examples of work can be found at http://www.boxhedge.com

              Comment

              Working...
              X