We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11316
    • 81 Posts
    Originally I had posted the line addition (’align’ => $params[’align’] //THIS LINE IS MISSING) for your Image TV to process the align.

    This will fix your align problems but it will also mark your image as Invalid HTML.
    Why would this happen? It has to do with how the drop widget works, in the core code a drop down menu is generated from a list in the mutate_tmplvars.dynamic.php.
    Automatically "none" is selected. This will make all your images align="none" which is invalid HTML.

    The Fix
    1. 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;


    2. manager/actions/mutate_tmplvars.dynamic.php - Roughly Line 100
    &align=Align;list;,baseline,top,middle,bottom,texttop,absmiddle,absbottom,left,right

    to
    &align=Align;string


    This will remove the drop down menu but it will make your HTML valid because if nothing is input it will not automatically add align="none".
    You can then input by typing - left, right, top ....(you should know these by heart now).

    Hope it helps
      • 20413
      • 2,877 Posts
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 11316
        • 81 Posts
        happy too - just balancing "dadda, come here, spongebob" Saturday night stuff.