ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

My RSS 2.0 feed is just not working right if I try anything fancy.

March 20, 2008 12:21am

Subscribe [6]
  • #1 / Mar 20, 2008 12:21am

    SC CTSI at USC

    7 posts

    My RSS 2.0 feed works fine when I do this for the description:

    <description>{exp:xml_encode}{experiment}{/exp:xml_encode}</description>

    However my actual weblog has a set of fields experiment, setup, ... and a field called standardpost which is used when I don’t want to use the other fields. So a entry in the weblog either has experiment and setup, ... filled up OR standardpost filled and I do this in my actual index display:

    {if standardpost}
    {standardpost}
    {if:else}
    {experiment}{setup}
    {/if}

    When I do this in my RSS 2.0 feed:

    <description>{exp:xml_encode}{if standardpost}{standardpost}{if:else}{experiment}{/if}{/exp:xml_encode}</description>

    the feed breaks…

    Can I not use if else statement in feeds? This has been driving me crazy.

  • #2 / Mar 20, 2008 1:47am

    Ryan Irelan

    444 posts

    You can use conditionals in your feed template, but you might want to try:

    {if standardpost != ''}{standardpost}{if:else}{experiment}{/if}
  • #3 / Mar 20, 2008 2:01am

    John Fuller

    779 posts

    Luke, use the source to battle the evil RSS Storm Troopers.  Can you post what EE actually spits out from the snippet?  Maybe you need to change the RSS fluid, is the indicator light blinking?

  • #4 / Mar 20, 2008 11:40am

    Jared Farrish

    575 posts

    You might also try:

    {if standardpost}{exp:xml_encode}{standardpost}{/exp:xml_encode}{if:else}{exp:xml_encode}{experiment}{/exp:xml_encode}{/if}
  • #5 / Mar 20, 2008 4:14pm

    mayrarub

    1 posts

    Thank you Jared Farrish, that worked flawlessly. I combined that with the knowledgebase article about how to use HTML in feeds and my feed is now up and running perfectly!

  • #6 / Mar 20, 2008 5:31pm

    Jared Farrish

    575 posts

    No problem. Glad it worked!

    😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases