We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30879
    • 40 Posts
    Hi Guys,

    Ive created an TV image widget.

    Its displaying the image correctly if i use [+summaryimage+]

    but if i try and set the align in the image widget properties is doesnt seem to update.

    if i set the class this changes but just not the align option - in the output code for the image theres no reference to align at all.

    Driving me nuts
      • 11316
      • 81 Posts
      it was missing from the php file : manager/includes/tmplvars.format.inc.php

      open file and add line after style code, dont forget the comma after [’style’],: ’align’ => $params[’align’]

      		$id = "tv$name";
      		switch($format){
      			case 'image':
      				$images = parseInput($value, '||', 'array');
      				$o = '';
      				foreach($images as $image){
      					if(!is_array($image)) { $image = explode('==',$image); }
      					$src = $image[0];
      
      					if($src) {
      						// We have a valid source
      						$attributes = '';
      						$attr = array(
      							'class' => $params['class'],
      							'src' => $src,
      							'id' => ($params['id'] ? $params['id'] : ''),
      							'alt' => htmlspecialchars($params['alttext']),
      							'style' => $params['style'],
      							'align' => $params['align'] //THIS LINE WAS MISSING!
      						);
      						foreach ($attr as $k => $v) $attributes.= ($v ? ' '.$k.'="'.$v.'"' : '');
      						$attributes .= ' '.$params['attrib'];
      
      						// Output the image with attributes
      						$o .= '<img'.rtrim($attributes).' />';
      					}
      				}
      			break;