I have a few that is grabbing all published nodes from certain categories, and it works great. What I'm trying to do is limit the view so it *just* grabs the most recently published node from each of the selected categories. Is that possible?
A workaround I'm trying now is to manually make the most recent one sticky and use that. It works, but it leaves room for error.
Comments
Comment #1
merlinofchaos commentedUnfortunately, what you want to do is quite difficult with SQL, which means it's quite difficult to do with Views. The only way I can think to do that offhand is to create several views, each one printing just one node, and chain them together on a custom page.
Comment #2
chellman commentedDang. Yeah, I hadn't looked at the tables to see how I'd do it with SQL, otherwise I might have known it was hard.
That was another possibility I had thought of. In that case, I'd be creating one view for each category and embedding them all on the main one. Is that right?
If I'm doing that, should the embedded views be provided as pages? I assume yes so they don't clutter up the blocks screen, but I wanted to check.
Comment #3
merlinofchaos commentedYou can have them provide neither page nor blocks if you like, though there are some side effects to doing that. For what you're doing I don't think those side effects will matter but you'll have to try it and see.
If you're doing it just for categories, you can also make it just 1 view, use the category as an argument, and call the view multiple times.
Comment #4
chellman commentedThanks, Merlin, I think I've done it. Check me on this approach, if you would.
If this is right, I'll probably post a comment on the relevant book page.
Comment #5
merlinofchaos commentedYes, that's pretty much in line with how I'd do it.
Comment #6
(not verified) commented