Forum
Multiple blogs' post categories
Sorry – I'm still going with the multiple blogs thing…! I've got multiple blogs (one called 'resources', the other called 'blog'). Each has its own categories set. Is there a conditional I can use with perch:if
to only use the 'blog' set on 'blog' blog posts and the 'resources' set on 'resources' blog posts?
Are you using different post templates for each?
Nope – the same template for both. Is that where I'm going wrong? Although is there a way to specify a certain post template in the
perch_blog_post(perch_get('s'));
call?If you used a different template for each you could specify a different category set for each.
Good shout. Passing the template into the the
perch_blog_post
call would work. I can't quite get the right way of doing it though as my php chops are weak… This doesn't work:Can you see where I'm going wrong…?
This works:
The problem is, its still using the post.html rather than post_resource.html in the control panel, so I can't apply the 'resource' categories to the post as it only shows the 'blog' set's categories.
You need to set up multiple post types: https://docs.grabaperch.com/addons/blog/post-types/
Ah, ok. Is there a way to assign a default post type to the 'blog' blog and another default post type to the 'resources' blog? If 'blog' is the overall default, that means I'd have to change the post type for every 'resources' post.
Sorry to be such a pain on this one :o
It's ok for my own blog, but if I was to implement the same for a client I want it to be as option-free as possible for them :)
Yes, use the setting in the blog options.
Sweet! Where do I set the option…?
Go to the Blog app, then Blogs, then select your Blog.
Awesome! Thank Drew :) https://media.giphy.com/media/W00Tz3LVFFTnG/giphy.gif