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

    I’ve added a Image TV to my website. I’ve set the output to ’image’, and the image
    displays correctly. But the image doesn’t align. I’ve set it to align ’right’.

    And another problem. How do I upload images? Now I’ve picked one from
    /manager/templates etc.

    Thanks smiley
      • 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;
        • 3749
        • 24,544 Posts
        Good catch. Would you file that as a bug using the Jira link at the top of this page.
        Thanks!
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 11316
          • 81 Posts
          happy too! total accident how i found that.