Hi,You have a little too much going on for me to be able to diagnose, such as the getResources call with tv's etc... If it were my system I would put in a page exactly as in the step by step instructions, make sure that works as expected and then slowly make the changes so that it works the way you need it to. That way you would be able to see where the program fails and have a better idea what is going wrong.
I seem to have a problem which is similar to what tajdik was having. i have tried the solutions posted so far and getImages still doesn't display anything, it is not outputting any template code let alone images.
I want to display images on my homepage. i have a getResources call which then displays a template for the corresponding post, in this case a photo gallery post.
getResources call:
.... <div id="content_inner"> <div id="plinth_wrapper"> [[!getResources? &showHidden=`1` &parents=`3,11,14` &tplCondition=`template` &conditionalTpls=`{"6":"frontpage-news-post","7":"frontpage-photos-post","9":"frontpage-events-post"}` &tpl=`frontpage-generic-post` &tvPrefix=`tv.` &includeTVs=`1` &processTVs=`1` &depth=`4` &limit=`6` ]] </div> <!-- plinth_wrapper --> </div> <!-- content_inner END --> ....
getImages call:
.... <div class="cp_post_container"> [[!getImages? &getImages_Folder=`assets/photos` &getImages_Ext=`*.jpg` &getImages_Tpl=`getImages_Tpl` &getImages_Limit=`6` &getImages_Offset=`8` &getImages_Width=`150` &getImages_Height=`100` &getImages_Border=`2` &getImages_Class=`img` ]] </div> <!-- cp_post_container END --> ....
below is a template i got from this thread just to try it out.
getImages_Tpl:
<div class="photos"> <a href="[[+imgLink]]" target="_blank"> <img title="[[+image]]" src="[[+path]].thumbs/lr_[[+imgFile]]" alt="[[+imgLink]]" height="[[+height]]" width="[[+width]]"> </a> </div>
i am using:
modx 2.3.2-pl
getImages 2.3.1-pl
i get these errors in the log:
[2015-02-08 10:44:01] (ERROR @ /modx-2.3.2-pl/connectors/index.php) Resource URI 2011/ already exists for resource id = 100; skipping duplicate resource URI for resource id = 214 [2015-02-08 10:44:01] (ERROR @ /modx-2.3.2-pl/connectors/index.php) Resource URI 2012/ already exists for resource id = 101; skipping duplicate resource URI for resource id = 215 [2015-02-08 10:44:01] (ERROR @ /modx-2.3.2-pl/connectors/index.php) Resource URI 2013/ already exists for resource id = 108; skipping duplicate resource URI for resource id = 216
This is my PHP:
PHP Version 5.3.3
If you need any other information, i will try to give it.
Tim
Thank you for the reply.No Problem. Great to hear it's working for you.
After a few days away from this, I just re-visited it and got it working. Maybe I was missing something out when doing it before.
I think fresh eyes and all that helped, sorry for bothering you with my original post.
Thanks
Tim
Great snippet ! Just what I was looking for.
Works great, but I have one question :
Is there a possibility to have random sorting ?
I want to have the images displayed in a different order each time the page is loaded.
$page = $modx->parseChunk($page_tpl); //call the formatting chunk and fill with the results
$page = $modx->parseChunk($page_tpl, $modx->placeholders); //call the formatting chunk and fill with the results
&getImages_Folder=`assets/album/folder-name/
&getImages_Folder=`assets/album/folder name/ or &getImages_Folder=`assets/album/folder%20name/
Is there any particular trick to specifying a folder name that has spaces in the name?
If I specify:
&getImages_Folder=`assets/album/folder-name/
the images are displayed.
However if I specify
&getImages_Folder=`assets/album/folder name/ or &getImages_Folder=`assets/album/folder%20name/
No images are displayed.
I'm trying to use an existing folder structure without having to rename anything.
Thanks.
I would also like the issue with the parseChunk() call to be fixed.
The error log says "PHP warning: Missing argument 2 for modX::parseChunk()".
It's in the getImages snippet on line 150:
$page = $modx->parseChunk($page_tpl); //call the formatting chunk and fill with the results
I have edited mine to this which prevents the error but not sure if it would cause any other problems.
$page = $modx->parseChunk($page_tpl, $modx->placeholders); //call the formatting chunk and fill with the results
Can this be fixed in the next version to stop the errors about missing argument? Another person suggested using getChunk as another possible solution.
Thanks!