Forum
Welcome, Guest
Please Login to access forum.
Re:How to limit to 10 K2 articles the RSS feed (1 viewing) 
Go to bottom
TOPIC: Re:How to limit to 10 K2 articles the RSS feed
#4446
Amar Guillen
Junior Boarder
Posts: 26
User Offline
[SOLVED]How to limit to 10 K2 articles the RSS feed Karma: 0  
Hello,

In Jsitemap Pro configuration, I set up to 10 the numbers of articles displayed in the "Limit to recent RSS articles" parameters.
It does not work. I always have all the published K2 articles listed in the list.

Please would you tell me how to set up that parameter correctly?

Thanks
 
Logged Logged  
  The administrator has disabled public write access.
#4447
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:How to limit to 10 K2 articles the RSS feed Karma: 79  
Hello, that parameter works as supposed but please take care that:

1. It refers to the number of days not the number of articles
2. It works for Joomla articles not for K2 articles

If you want to limit the number of K2 articles to the most 10 recent ones, you need to change the Raw SQL query as below:

Code:

SELECT `#__k2_items`.`title`, `#__k2_items`.`modified`, CONCAT_WS(':', `#__k2_items`.`id`, `#__k2_items`.`alias`) AS `id`, `#__k2_items`.`catid`, `#__k2_items`.`publish_up`, `#__k2_items`.`metakey`, `#__k2_categories`.`name` FROM `#__k2_items` JOIN `#__k2_categories` ON `#__k2_items`.`catid` = `#__k2_categories`.`id` WHERE `#__k2_categories`.`published` = '1' AND `#__k2_items`.`published` = '1' AND `#__k2_items`.`access` IN {aid} AND (`#__k2_items`.`language` = '*' OR `#__k2_items`.`language` = '' OR `#__k2_items`.`language` = {langtag}) AND `#__k2_items`.`trash` = '0' AND (`#__k2_items`.`publish_down` > NOW() OR `#__k2_items`.`publish_down` = '0000-00-00 00:00:00') ORDER BY `#__k2_items`.`created` DESC LIMIT 10
where at the bottom you see the custom ordering and limit
Code:

ORDER BY `#__k2_items`.`created` DESC LIMIT 10
 
Logged Logged  
  The administrator has disabled public write access.
#4448
Amar Guillen
Junior Boarder
Posts: 26
User Offline
Re:How to limit to 10 K2 articles the RSS feed Karma: 0  
Hello,

thank you very much for your quick reply.

Would you please tell me where to insert the SQL code?

Thank you
 
Logged Logged  
  The administrator has disabled public write access.
#4449
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:How to limit to 10 K2 articles the RSS feed Karma: 79  
Yes sure,

i was referring to the SQL code inside the K2 items data source.
 
Logged Logged  
  The administrator has disabled public write access.
#4455
Amar Guillen
Junior Boarder
Posts: 26
User Offline
Re:How to limit to 10 K2 articles the RSS feed Karma: 0  
Hello,

I still need your help.
Here are the steps I did so far:
- I created a new Sitemap datasource using your sql query.
- I created a new Dataset based on the sitemap datasource


So now what should I do to create my RSS feed?

Thanks again for your help
 
Logged Logged  
  The administrator has disabled public write access.
#4456
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:How to limit to 10 K2 articles the RSS feed Karma: 79  
Hello,

it's easy you have 2 choices:

1. Use the method that you did now, create a dataset including only the data source with the custom query. At that point in the control panel you have a dropdown to select the dataset and all links will refresh for that dataset, including the RSS feed link

2 Don't use datasets, simply use the options of each data source to exclude/include it in the RSS feed. So you can have the regular K2 data source excluded and the custom K2 data source included in the RSS feed

Hope to have explained well.
 
Logged Logged  
  The administrator has disabled public write access.
Go to top