jploch Posted September 27, 2015 Share Posted September 27, 2015 Hello! I have a problem with the order my images display on a gallery iam building for my new homepage. My gallery displays an image for every page that has the parent "work" and the field thumbnail. It works, but the images seemes to be sorted by the time the page was createted. I want the order of the images to be the order of the pages (I want to use the "move" button in pw to rearrange them). Here is my code: <?php $projects = $pages->find("parent=/work/"); foreach($projects as $project) { $out .="<a href='{$project->url}' class='item {$project->thumbnail->tags}'>"; if($project->thumbnail){ $out .="<img src='{$project->thumbnail->url}'>"; } $out .="<div class='item-info'><h1>{$project->title}</h1><p>{$project->thumbnail->description}</p></div>"; $out .="</a>"; } echo $out; ?> Thanks! Link to comment Share on other sites More sharing options...
kongondo Posted September 27, 2015 Share Posted September 27, 2015 Have you tried sort=sort in your find? $projects = $pages->find("parent=/work/, sort=sort"); Link to comment Share on other sites More sharing options...
jploch Posted September 27, 2015 Author Share Posted September 27, 2015 Have you tried sort=sort in your find? $projects = $pages->find("parent=/work/, sort=sort"); Thanks kongondo for the super fast reply! That was exactly what I was looking for. Problem solved! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now