0

I have a channel that has 20 categories - each representing a client who can post there or have others post there for their attention.

Of these 20 categories/clients one (only one) needs a personal RSS feed - is it possible to have a feed showing the one category only? Docs seem a bit unclear on this.

3

The entries on a feed are created by the Channel Module. You can create a template just for it or add the category_id as a segment.

Let's say the feed is on /xml/feed. The filtered feed can be available at /xml/feed/25, for example:

<?xml version="1.0" encoding="{encoding}"?>
<rss [...]>

    <channel>
    [...]
    {exp:channel:entries [...] category="{segment_3}"}
        [...]

If you're using version 2.9, you can even test to make sure the {segment_3} is a number.

{if segment_3 ~ "/^\d+$/"}
    {preload_replace:pr-client_category="{segment_3}"}
{/if}
{preload_replace:pr-client_category=""}{!-- default empty value --}
<?xml version="1.0" encoding="{encoding}"?>
<rss [...]>

    <channel>
    [...]
    {exp:channel:entries [...] category="{pr-client_category}"}
        [...]

It's pretty easy!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.