I am looking to specify the amount of news to show per category and came accross this post which goes some way to what I want, but seems to apply to all news rather than by category.
Please can you point me in the right direction regarding code:
I have static pages where I would like one news item in a category (say about_us) and others where I would like to specify four or five news items per page (say a blog page).
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
The reason this isn't possible with system is that there simply is no easy way to do it. The way the system works at the moment is first grabs all the variables you specify before an include, authors, categories ect. It then forms these into 1 single query string that looks something like this
Code:
SELECT fields FROM newstable join categorytable join usertable WHERE cats IN [1,2,3,4,5] AND authors IN [1,2,3,4,5] ORDER BY posted LIMIT 0, 10
The LIMIT is at the end of the query which only allows you to limit the total results to a certain amount.
The only way to do what you want would be to use multiple queries then join the results possibly using UNION but like before, there currently is no easy way of doing this.