How to output the height and width of an Image TV
on 13-Sep-2009 | Comments ( 2 ) Tags: Evolution
Assumptions:
- You have an image TV created and the widget field is empty.
- PHx is installed
Create the width phx extender
Create a new snippet phx:width and paste the following code:
<?php list($width, $height,$type,$attr) = getimagesize($output); return $width; ?>
Create the height phx extender
Create a new snippet phx:height and paste the following code:
<?php list($width, $height, $type, $attr) = getimagesize($output); return $height; ?>
Use with Ditto or other snippets
<img src="[+imageTV+]" alt="" width="[+image:width+]" height="[+image:height+]" />
Direct TV output
<img src="[*imageTV*]" alt="" width="[*image:width*]" height="[*image:height*]" />
I was amazed at how simple it was to do this in modx. If you know other solutions leave a comment.
Write a comment
Posts: 2
Reply #2 on : Wed December 09, 2009, 14:49:52
Posts: 2
Reply #1 on : Thu December 10, 2009, 11:58:44