Announcement

Collapse
No announcement yet.

Stock Message on Radio Buttons

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

    Stock Message on Radio Buttons

    Hi all,

    Seen the AUG for enabling a stock message next to choices in a drop down list, based on associated products, but anyone come across achieving this using Radio Buttons instead of the drop down?

    Would have thought it would be simple enough with a few conditions around the radio button code, but not so, so wondering if the collective has worked this one out at all yet.

    Cheers.

    #2
    It's a bit tricky as the fix in the Advanced User Guide is based around the 'Permutation Lists' that come with v8 - and they are different code from the Choice Lists. Hang on, let me take a look...


    Right

    Go to the 'Components' group in the library, create a new layout (called something like 'Component with Radio Button Permutations') and use the following code for the layout...

    Code:
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentDisplayLabel%22%20%2f%3e%20%21%3d%20%22%22">
    	<br />
    </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>
    <Actinic:Variable Name="ComponentDisplayLabel" />
    
    <br />
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentIsOptional%22%20%2f%3e%20AND%20%3cactinic%3avariable%20name%3d%22IsUsedNoneChoiceLabel%22%20%2f%3e%20AND%20%21%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e" >
    <input type="radio" checked="checked" name="<actinic:variable name="PermutationAttributeList" value="Attribute IDs" />" value="-1" /> <actinic:variable name="NoneChoiceLabel" /> <br />
    </actinic:block>
    <actinic:block type="PermutationList" >
    <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationIsValid%22%20%2f%3e">
    <input type="radio" <actinic:block if="%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201%29%20AND%20%28%3cactinic%3avariable%20name%3d%22IsUsedNoneChoiceLabel%22%20%2f%3e%20%3d%3d%20false%29" >checked="checked"</actinic:block> name="<actinic:variable name="PermutationAttributeList" value="Attribute IDs" />" value="<actinic:variable name="PermutationChoiceList" value="Permutation Choice ID List" />" />
       <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationAssociatedNameIsUsed%22%20%2f%3e%20%3d%3d%20FALSE">
    	   <actinic:variable name="PermutationChoiceList" value="Permutation Choice Name List" />
       </actinic:block>
       <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationAssociatedNameIsUsed%22%20%2f%3e">
          <actinic:variable name="AssociatedProduct::ProductName" />
       </actinic:block>
       <actinic:variable name="PermutationPrice" />
       <br />
    </actinic:block>
    </actinic:block>

    Comment


      #3
      Is there any way of getting this to work when showing images with the radio buttons?

      Comment


        #4
        Hi there. Below is an extension of the 'Advanced User Guide' excercise, which displays permutations as radio buttons, and also allows you to specify an image per permutation.

        In order to do this, you need to create a new component layout called 'Permutations as Radio Buttons', and copy the following code in:

        Code:
        <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentDisplayLabel%22%20%2f%3e%20%21%3d%20%22%22">
        	<br />
        </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>
        <Actinic:Variable Name="ComponentDisplayLabel" />
        
        <br />
        <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentIsOptional%22%20%2f%3e%20AND%20%3cactinic%3avariable%20name%3d%22IsUsedNoneChoiceLabel%22%20%2f%3e%20AND%20%21%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e" >
        <input type="radio" checked="checked" name="<actinic:variable name="PermutationAttributeList" value="Attribute IDs" />" value="-1" /> <actinic:variable name="NoneChoiceLabel" /> <br />
        </actinic:block>
        <actinic:block type="PermutationList" >
        <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationIsValid%22%20%2f%3e">
        <input type="radio" <actinic:block if="%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201%29%20AND%20%28%3cactinic%3avariable%20name%3d%22IsUsedNoneChoiceLabel%22%20%2f%3e%20%3d%3d%20false%29" >checked="checked"</actinic:block> name="<actinic:variable name="PermutationAttributeList" value="Attribute IDs" />" value="<actinic:variable name="PermutationChoiceList" value="Permutation Choice ID List" />" />
           <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationAssociatedNameIsUsed%22%20%2f%3e%20%3d%3d%20FALSE">
        	   <actinic:variable name="PermutationChoiceList" value="Permutation Choice Name List" />
           </actinic:block>
           <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationAssociatedNameIsUsed%22%20%2f%3e">
              <actinic:variable name="AssociatedProduct::ProductName" />
           </actinic:block>
           <actinic:variable name="PermutationPrice" />
           <img src="<actinic:variable name="PermImage" />" />
           <br />
        </actinic:block>
        </actinic:block>
        You also need a new 'Filename' variable which is settable at the 'Permutation' level called 'PermImage'. You will then be able to enter images for each permutation at the bottom of the 'Permutations' tab.

        Comment

        Working...
        X