Elxis CMS Forum
Extensions => Components => Topic started by: armpouniotis on February 01, 2009, 19:58:47
-
Hi all !
I have made a website with several categories. I have also made a 2nd website, in which I display the contents of the first site through RSS.
How can I display the contents of a specific category of the 1st site, and not all the Frontpgage items ???
thank you in advance
Chris
-
elxis rss showing only firstpage items
maybe in future versions including rss by category....
-
This is not right.
Elxis can be set to display in RSS feeds the front-page items (default option due to backwards compatibility) or any content item.
Administration -> Components -> Syndicate
Set "Frontpage Items" parameter to "No" to generate RSS feeds from any content item.
Empty cache or wait some time in order for the RSS feeds to be re-generated after you change this option.
Additionally Elxis displays RSS from eblogs too (placed last in the XML file).
See here an example: https://www.elxis.org/cache/rss20.xml (https://www.elxis.org/cache/rss20.xml)
-
Thank you datahell
but, can you explain further how to display the content items of a specific category ???
-
From a specific category you can't without hacking Elxis. Elxis will export the latest items from all categories.
But you can do this with a small and easy hack. Do exactly what I will write to you bellow if you wish to export content items only from a specific category (or from more than one).
1. Set in Syndication component in Elxis administration to export content items from all categories.
2. Open components/com_rss/rss.php with a text editor such as pspad (pspad.com)
Go to line 161 and add bellow:
If you wish to display content items from just one category:
."\n AND a.catid = 'XXX'"
If you wish to display content items from just more than one category separate multiple category IDs with comma:
."\n AND a.catid IN (XXX,YYY,ZZZ)"
Where XXX, YYY, ZZZ the category ID(s).
In the end rss.php will look like this (in this example the category id is 5):
$query .= "\n LEFT JOIN #__users u ON u.id = a.created_by"
."\n WHERE a.state = '1' AND a.access = '29'"
."\n AND a.catid = '5'"
."\n AND ( a.publish_up = '1979-12-19 00:00:00' OR a.publish_up <= '". $now ."' )"
or like this (in this example the category IDs are 5, 8 and 27):
$query .= "\n LEFT JOIN #__users u ON u.id = a.created_by"
."\n WHERE a.state = '1' AND a.access = '29'"
."\n AND a.catid IN (5,8,27)"
."\n AND ( a.publish_up = '1979-12-19 00:00:00' OR a.publish_up <= '". $now ."' )"
3. Save the file and upload it in your server replacing existing one.
You can get the category IDs from Elxis administration (categories manager).
-
Thank you very much datahell !
i will try it and i will let you know about it
best regards
-
Hello, I need to publish Newsflash category on rss and I was edit my code, category ID is 1:
code is from 162 - 166 line
$query .= "\n LEFT JOIN #__users u ON u.id = a.created_by"
."\n WHERE a.state = '1' AND a.access = '29'"
."\n AND a.catid = '1'"
."\n AND ( a.publish_up = '1979-12-19 00:00:00' OR a.publish_up <= '". $now ."' )"
."\n AND ( a.publish_down = '2060-01-01 00:00:00' OR a.publish_down >= '". $now ."' )";
And I dod not get any result, version of Elxis is 2009.1 DEV rev2563 [ Hecate ] 10-Oct-2009 11:33 GMT+2
Link for rss is http://www.stantonridgecc.com/cache/rss20.xml
-
I find my error, I forget to publish article in newsflash category... :-[ Sorry
-
;) ;D
-
From a specific category you can't without hacking Elxis. Elxis will export the latest items from all categories.
But you can do this with a small and easy hack. Do exactly what I will write to you bellow if you wish to export content items only from a specific category (or from more than one).
1. Set in Syndication component in Elxis administration to export content items from all categories.
2. Open components/com_rss/rss.php with a text editor such as pspad (pspad.com)
Go to line 161 and add bellow:
If you wish to display content items from just one category:
."\n AND a.catid = 'XXX'"
If you wish to display content items from just more than one category separate multiple category IDs with comma:
."\n AND a.catid IN (XXX,YYY,ZZZ)"
Where XXX, YYY, ZZZ the category ID(s).
In the end rss.php will look like this (in this example the category id is 5):
$query .= "\n LEFT JOIN #__users u ON u.id = a.created_by"
."\n WHERE a.state = '1' AND a.access = '29'"
."\n AND a.catid = '5'"
."\n AND ( a.publish_up = '1979-12-19 00:00:00' OR a.publish_up <= '". $now ."' )"
or like this (in this example the category IDs are 5, 8 and 27):
$query .= "\n LEFT JOIN #__users u ON u.id = a.created_by"
."\n WHERE a.state = '1' AND a.access = '29'"
."\n AND a.catid IN (5,8,27)"
."\n AND ( a.publish_up = '1979-12-19 00:00:00' OR a.publish_up <= '". $now ."' )"
3. Save the file and upload it in your server replacing existing one.
You can get the category IDs from Elxis administration (categories manager).
Continuing on this old, but very useful post, I would like to ask how i could have the rss urls for each category, so to publish them in an autonomous page for case that my site's visitors would like to use them as RSS information.