Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi,

I was following your tutorial for making an rss feed for my site. I saved the file as rss.php on my root folder. When I tried to access it on my google reader, it can't detect the feed. I tried accessing www.fouridine.com/rss.php and it brings me to the couch login page. Is this why the reader was unable to access my feed?
Hi,

I followed your RSS link and it seems to be working just fine. Have you made any changes after posting the problem?
Hey yeah, it was quirky before and redirected me to the couch login.

With regards to the rss feed content, how do I show the videos and images in my posts?

I tried copying and pasting the code from my file list_images.html, removing all the divs and it doesn't work.

Code: Select all
       <images>
            <cms:html_encode>
                <cms:excerptHTML>
                               <cms:if video>
                                   <iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/<cms:show video />" frameborder="0" allowfullscreen></iframe>
                                </cms:if>
   
                            <cms:repeat count='6' startcount='1' >
                               <cms:set my_img_src="<cms:get "gallery_img_<cms:show k_count />" />" />
                           
                               <cms:if "<cms:not_empty my_img_src />" >
                                  <cms:if k_count != '1'>style="display:none;"</cms:if>><img src="<cms:show my_img_src />" />
                               </cms:if>
                            </cms:repeat>               
                </cms:excerptHTML>
            </cms:html_encode>       
        </images>
Hi,

Apologies for this inordinate delay but we have been busy with the new release of Couch.

Answering your query about images and video in RSS feed - I see that you have tried using <images> tag in your feed. RSS specification has an <image> (not 'images' ) tag but there can be only one such tag per channel so this is not what we need.

Images and videos can simply be displayed as part of the <description> </description> tag wrapping them with the regular <cms:html_encode> tag.

In your case, the modified feed will become as follows -
Code: Select all
<cms:content_type 'text/xml' /><cms:concat '<' '?xml version="1.0" encoding="' k_site_charset '"?' '>' />
<rss version="2.0">
  <channel>
    <title>Fouridine's Portfolio</title>
    <link><cms:show k_site_link /></link>
    <description>Description of this channel.</description>
    <language>en-us</language>
    <pubDate><cms:date format='D, d M Y H:i:s' gmt='1'/> GMT</pubDate>
    <generator>Couch CMS</generator>

    <cms:pages masterpage='work.php' limit="10">
    <item>
        <title><cms:show k_page_title /></title>
        <link><cms:show k_page_link /></link>

        <description>
            <cms:html_encode>
                <cms:excerptHTML><cms:show work_content/></cms:excerptHTML>
            
            <div class="work_pc">
               <cms:if video>
                  <iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/<cms:show video />" frameborder="0" allowfullscreen></iframe>
               </cms:if>

               <cms:repeat count='6' startcount='1' >
                  <cms:set my_img_src="<cms:get "gallery_img_<cms:show k_count />" />" />

                  <cms:if "<cms:not_empty my_img_src />" >
                     <div id="photo_<cms:show k_page_id />_<cms:show k_count />" ><img src="<cms:show my_img_src />" /></div>
                  </cms:if>
               </cms:repeat>
            </div> 
            
            </cms:html_encode>
        </description>

        <pubDate><cms:date k_page_date format='D, d M Y H:i:s' gmt='1'/> GMT</pubDate>
    </item>
    </cms:pages>

</channel>
</rss>

Note how we show only an excerpt of the text and then go on to show the images/video if present.

Some feed readers always strip off images/videos while displaying a feed so if you are unable to see them in a particular reader, try another one. I have confirmed that images/videos appear as expected in Google Reader.

Hope this helps.
4 posts Page 1 of 1