Announcement

Collapse
No announcement yet.

Problem adding image to Radio button choice

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

    Problem adding image to Radio button choice

    Hi

    I'm trying to add images to radio buttons but can't seem to get it to work. I followed the instructions in AUG to the letter - ie. create new variable ChoiceImage and cut&paste code into RadioButtonChoice - but it's not showing the image field.

    I then tinkered around (as you do) with the 'Place of setting' option within the ChoiceImage field and ticked the 'attributes' field as well. This then displayed the option to select the image, which I did - but it still doesn't display the image. The image exists within the site1 folder.

    Any ideas please?

    #2
    I wrote that add-on. I just followed the AUG instructions and it worked here with no problems.

    Are you sure that you're displaying Radio Buttons for that Attribute?

    This won't work if you use the default of Standard Drop Down Attribute. Click the Attribute then look in the Layout tab / Attribute / Attribute Layout.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      oops!!!!! It helps if you add the image to choice and not attribute!!! Thanks Norman!

      One other question - is there a way that I can display the image either above or below the choice text?

      Thanks in advance

      Comment


        #4
        Edit layout Radio Button Choice and move things around. There are 3 lumps of code that should be considered:

        The radio button
        Code:
        <input type="radio" name="<Actinic:Variable Name="UIWidgetName"/>" value="<Actinic:Variable Name="ChoiceSelectedValue"/>"<actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201">checked="checked"</actinic:block> />

        The Choice name
        Code:
        <Actinic:Variable Name="ChoiceDisplayLabel"/>
        The image
        Code:
        <actinic:block php="true">
        	$choiceimage = '<Actinic:Variable Name="ChoiceImage" encoding="perl" selectable="false" />';
        	if ( $choiceimage )
        		{
        		list($width, $height, $type, $attr) = getimagesize($choiceimage);
        		if ( $width )
        			{
        			echo " <img src=\"$choiceimage\" width=\"$width\" height=\"$height\" />";
        			}
        		else
        			{
        			echo "<font color=\"red\"><b> BAD IMAGE</b></font>";
        			}
        		}
        </actinic:block>
        To put the image below the button and name just add <br /> after

        <Actinic:Variable Name="ChoiceDisplayLabel"/>
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Ok... I'll give that a go and thanks very much - I really appreciate it.

          Comment

          Working...
          X