Hello,
I was create a new media source as (name:
offre):
basePath = '/publique/offre/'
basePathRelative = Yes
baseUrl = '/publique/offre/'
baseUrlRelative = Yes
And, this tv : '
photo', the media source used is '
offre'.
When I want to generate a thumb, I use
phpthumbof, like
$id = $modx->resource->get('id');
$TVs = $modx->getObject('modResource', $id);
$photo = $TVs->getTVValue('photo');
$output =$modx->runSnippet('phpthumbof', array('input'=>$photo, 'options'=>'w=100&h=100&zc=1'));
But, the media source used is not define under the
phpthumbof snippet, I must add the '/publique/offre/' string before my $photo string if I want the thumb generate correctly, like:
$photo = '/publique/offre/' . $TVs->getTVValue('photo');
$output =$modx->runSnippet('phpthumbof', array('input'=>$photo, 'options'=>'w=100&h=100&zc=1'));
My question is, how to, for a tv (here '
photo') return the media source used, and construct my $photo string with it !
Thanks.