encho Posted November 18, 2012 Author Share Posted November 18, 2012 Can you paste full code you have now? It is my code from above wrapped into your code you suggested few posts above $results = $page->children("limit=25"); if($page->path != '/' && $page->numChildren) { echo "<ul class='nav'>"; foreach($page->children as $child) { echo "<li>"; if (count($child->images)) { echo "<div style='float:right;'><img style='margin:5px 0 5px 5px;' src='{$child->images->first()->size(100, 100)->url}' alt='' /></div>"; } echo "<div><a href='{$child->url}'>{$child->title}</a><br /><span class='summary'>"; if ($child->summary){ echo preg_replace('/\s+?(\S+)?$/', '', substr($child->summary, 0, 251))."…"; } else echo strip_tags(preg_replace('/\s+?(\S+)?$/', '', substr($child->body, 0, 251)))."…"; echo "</span></div></li>"; } echo "</ul>"; } echo $results->renderPager(); Link to comment Share on other sites More sharing options...
nik Posted November 18, 2012 Share Posted November 18, 2012 Change that line with the foreach to foreach($results as $child) { That should do it. The first line could be inside the if block too, but should work there as well. 1 Link to comment Share on other sites More sharing options...
encho Posted November 18, 2012 Author Share Posted November 18, 2012 And that does it. When I look at it now it seems obvious. I have more things to learn, but definitely worth it. The speed of this CMS is simply amazing, well done everyone! 1 Link to comment Share on other sites More sharing options...
onjegolders Posted November 18, 2012 Share Posted November 18, 2012 And that does it. When I look at it now it seems obvious. I have more things to learn, but definitely worth it. The speed of this CMS is simply amazing, well done everyone! It gets better and better the more you learn, trust me! I knew nothing when I first started here and now I know a little bit more than nothing! 1 Link to comment Share on other sites More sharing options...
encho Posted November 18, 2012 Author Share Posted November 18, 2012 I found this site by accident, and now I'm so happy that I did. Simplicity of PW really makes my life easier. Some other more popular CMS solutions have big forums with loads of members, but quantity != quality. I just started using this and already have two pages of helpful posts! Kudos to the 'fanatical support' 1 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