Blogprint - How do I display posts from a specific category on a page

Heja,

i use the Blogprint plugin http://getkirby-plugins.com/blogprint on my website and it works fine. Now i want to display posts from a specific category. Actually all posts from all category will be shown!

How can i do this with the Blogprint plugin?

Thank you for your help

Okaoo

You can replace the code in the posts.php controller like this:

// get all posts
  $posts = $page->children()
                ->visible()
                ->filterBy('category', 'some-category')
                ->flip();

I have a blog page with all posts and an other blog overview page with a specific category. If i do this in the controller posts.php, then i will change it for all.

How can i handle this in the templates/posts.php https://github.com/ausminternet/blogprint/blob/master/site/templates/posts.php), that i have the option to change it or preasign it for each blog?

Obviously, both blog pages then use the same controller and the same template. Then you would have to use an if-statement in your controller that checks which page you are on and then filter depending on that, something like:

if($page->uid() == 'normal-blog') {
  $posts= $page->children()
                ->visible()
                ->flip();
} else if($page->uid() == 'filtered-blog') {
  $posts = $page->children()
                ->visible()
                ->filterBy('category', 'some-category')
                ->flip();
}

it seems that the blogprint-plugin dont support an other blog overview page (like wordpress). All tag-archiv oder category-archiv and other problems doesn’t work! :confused:

And texnixe thank you for your support! :slight_smile: