<![CDATA[ How to create a custom Type TV considering MediaSource? - My Forums]]> https://forums.modx.com/thread/?thread=98390 <![CDATA[How to create a custom Type TV considering MediaSource?]]> https://forums.modx.com/thread/98390/how-to-create-a-custom-type-tv-considering-mediasource#dis-post-532065
Displayed: imagename.jpg
Should so: /assets/images/imagename.jpg

MediaSource displayed only type of image and file, it is necessary somehow to add my type myTypeImage. Specify it /core/model/modx/modtemplatevar.class.php, line 291

public function prepareOutput($value, $resourceId= 0) {
        /* Allow custom source types to manipulate the output URL for image/file tvs */
        $mTypes = $this->xpdo->getOption('manipulatable_url_tv_output_types',null,'image,file');
        ...
}


I am trying to do so, but it did not work
$this->xpdo->setOption('manipulatable_url_tv_output_types','image,file,myTypeImage');


P.S. Sorry for my English]]>
jeendream Sep 23, 2015, 01:24 AM https://forums.modx.com/thread/98390/how-to-create-a-custom-type-tv-considering-mediasource#dis-post-532065
<![CDATA[Re: How to create a custom Type TV considering MediaSource?]]> https://forums.modx.com/thread/98390/how-to-create-a-custom-type-tv-considering-mediasource#dis-post-532072 I think, I would have it done exactly like that.]]> Bruno17 Sep 23, 2015, 03:30 AM https://forums.modx.com/thread/98390/how-to-create-a-custom-type-tv-considering-mediasource#dis-post-532072 <![CDATA[Re: How to create a custom Type TV considering MediaSource?]]> https://forums.modx.com/thread/98390/how-to-create-a-custom-type-tv-considering-mediasource#dis-post-532070
Plugin to an event "OnWebPageInit" and wrote the following code:
case 'OnWebPageInit':
        $this->xpdo->setOption('manipulatable_url_tv_output_types', 'image,file,myTypeImage');
        break;


Or
case 'OnWebPageInit':
        $mTypes = $this->xpdo->getOption('manipulatable_url_tv_output_types',null,'image,file').',myTypeImage';
        $this->xpdo->setOption('manipulatable_url_tv_output_types', $mTypes);
        break;
]]>
jeendream Sep 23, 2015, 02:33 AM https://forums.modx.com/thread/98390/how-to-create-a-custom-type-tv-considering-mediasource#dis-post-532070