E
E
Elena2018-04-14 18:15:49
MODX
Elena, 2018-04-14 18:15:49

How to output through pdoresources contents of migx fields with multiload?

Hello!
The task is as follows: there is a page that displays albums of projects. I made the albums themselves separate resources in order to use migx multi-download for each album (read below why). All album resources are displayed on the parent page via pdoresources as follows:


Chunk output for pdoresorces:
<div class="portfolio_our-houses_albums">
    <a href="" class="album-image"><img src="" alt=""><span class="album-title"></span></a>
    
</div>

where "portfolio_our-houses_album-item" is our multiload field.
Well, the template itself for this field:
<a href=""></a>
It displays the migx fields, everything is fine, only the path it prescribes for the photos is the id of the parent (that is, the resource in which we display, and not in which we fill in additional fields), and loads them when filling in the fields in the resources themselves to the correct folder - with the id of the resource itself.
That is, he writes the path for photos uploaded via migx like this:
"107" is the id of the resource where we display these fields, and the resource from which the id fields are 109 and 112.
I can’t understand what’s wrong and where to look for the reason . What did I do wrong here, or do I need to add something else?
PS Why did you decide to split it into different resources?
I tried to do it in one resource, but this type of migx download loads all the pictures into a folder with the resource id, but the folders need to be different so that all the photos are not in the same pile. All these checkboxes "published" in additional fields do not work at all, it still displays all the photos uploaded to the folder for all additional fields (that is, in each album all the photos from the page are scrolled anyway). It would be possible to simply make different file sources, I did this with another page, but there were two galleries there and there will be no more. And in this case, the number of albums (inside each magnific gallery) can be unlimited, so this method will not work. Therefore, I decided to split the albums by resources so that migx would load the photo of each album into the folder of the corresponding resource. Well, in case they suddenly ask another gallery to do it, not Magnific,
But something seems to be not a very good idea, at least with the idea with migx, although in theory (judging by the articles about multiloading) it should display the contents of the additional fields of the resource in which these additional fields were filled, and not the parent.
Has anyone done this and know what is wrong here?
The test page itself: u0485156.cp.regruhosting.ru/intereryi-domov.html

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elena, 2018-04-14
@HelenStar

Question removed! As I thought - it's in the cache. I just didn't know where to look for it. And I deleted the cache from the core folder, and that I just didn’t do it. But I couldn’t think that even in File Sources you need to make the call non-cached)
Thanks to the author of the question here https://modx.ru/vopros-answer/info/2663/
Well, or here too: https://forums.modx.com/ thread/99755/migx-multiupl...
PS Prior to this, I did not come across these links in Yandex when searching (This would save a couple of days of searching for an answer.
If anyone is interested, the answer is simple: in the paths in the file source, we prescribe a non-cached call to migxResourceMediaPath:
[ [!migxResourceMediaPath?&pathTpl=`img/portfolio/projects/{id}/` &createFolder=`1`]] :-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question