Jump to content

PW for online magazine


encho
 Share

Recommended Posts

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

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!

  • Like 1
Link to comment
Share on other sites

:) 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' :)
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...