<![CDATA[ Nested MigX Image Path + Custom Media Source - My Forums]]> https://forums.modx.com/thread/?thread=101641 <![CDATA[Nested MigX Image Path + Custom Media Source]]> https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548213
1. I'm not using MigX DB
2. I'm building the strucures inside the MigX manager using formtabs and columns
3. A normal MigX not nested works perfectly fine with the Custom Media Source
4. The nested images path is working right if the Image mediasource is the default one:
mgr 1
web 1

But if I try to use the Custom Media Sourse called: WebFiles ID 2 (the path is not right):
eg:

path with mediasource: mgr 1 - web 1
assets/web/user_files/image.jpg

path with custom mediasource: mgr 2 - web 2
image.jpg

I can add the path manually but that is not the right way and I'm using pthumb to set the image size:
[[+image:pthumb=`w=280&h=210&q=60&zc=1`]]

I tried everything but no luck, no idea what else can I do, any help please?

Here the Custom Media Sourse: WebFiles ID 2

basePath
Textfield
assets/web/user_files/
 
basePathRelative
Yes/No
Yes
 
baseUrl
Textfield
assets/web/user_files/
 
baseUrlRelative
Yes/No
Yes
 
allowedFileTypes
Textfield
 
 
imageExtensions
Textfield
jpg,jpeg,png,gif
 
thumbnailType
List
PNG
 
thumbnailQuality
Textfield
75
 
skipFiles
Textfield
.svn,.git,_notes,nbproject,.idea,.DS_Store



Apart of that, everything is working well, the nested MigX is showing images and everyhting looks good.
The custom Media Source is because I don't want some users have access to rood files obviously.

Thank you very much, cheers!]]>
Ysanmiguel Jan 20, 2017, 02:16 PM https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548213
<![CDATA[Re: Nested MigX Image Path + Custom Media Source]]> https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548585 Bruno17 Feb 07, 2017, 07:07 AM https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548585 <![CDATA[Re: Nested MigX Image Path + Custom Media Source]]> https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548562
Parse error: syntax error, unexpected '$output' (T_VARIABLE) in /home/www/core/cache/includes/elements/modsnippet/31.include.cache.php on line 4
]]>
neoziox Feb 06, 2017, 11:58 AM https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548562
<![CDATA[Re: Nested MigX Image Path + Custom Media Source]]> https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548243 Excellent, it's working perfect.

Cheers!]]>
Ysanmiguel Jan 22, 2017, 03:38 PM https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548243
<![CDATA[Re: Nested MigX Image Path + Custom Media Source (Best Answer)]]> https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548240
<?php
$output = str_replace('./','',$input);
if ($mediasource = $modx->getObject('sources.modMediaSource',$options)){
    $output = $mediasource->prepareOutputUrl($output);
}
return '/' . $output;


use it like that:

[[+image:add_mediasourcepath=`2`:pthumb=`w=280&h=210&q=60&zc=1`]]




]]>
Bruno17 Jan 22, 2017, 12:40 PM https://forums.modx.com/thread/101641/nested-migx-image-path-custom-media-source#dis-post-548240