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.

Limit the RSS feed words

April 17, 2008 2:54pm

Subscribe [3]
  • #1 / Apr 17, 2008 2:54pm

    imagi-nation

    60 posts

    In my weblog I have only one custom field for the full story and on the home page I limit this with the word_limit extension. It is possible to limit the number of words that an RSS provide? The word_limit extension don’t work…

  • #2 / Apr 17, 2008 4:11pm

    Sue Crocker

    26054 posts

    imagi-nation, have you considered using Word Limit Plus?

  • #3 / Apr 17, 2008 5:00pm

    imagi-nation

    60 posts

    I did it now, but is not working. I use the default RSS template, but the plugin may be outdated.

    {assign_variable:master_weblog_name="my_weblog"}
    {exp:rss:feed weblog="{master_weblog_name}"}
    
    <?xml version="1.0" encoding="{encoding}"?>
    <rss version="2.0"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:admin="http://webns.net/mvcb/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:content="http://purl.org/rss/1.0/modules/content/">
    
        <channel>
        
        <title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
        <link>{weblog_url}</link>
        <description>{weblog_description}</description>
        <dc:language>{weblog_language}</dc:language>
        <dc:creator>{email}</dc:creator>
        <dc:rights>Copyright Echipa de Stiri SA{gmt_date format="%Y"}</dc:rights>
        <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        <admin:generatorAgent rdf:resource="http://expressionengine.com/" >
        
    {exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{title_permalink=site/index}</link>
          <guid>{title_permalink=site/index}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description>{exp:xml_encode}{my_weblog_custom_field}{/exp:xml_encode}</description>
          <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
          <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        </item>
    {/exp:weblog:entries}
        
        </channel>
    </rss>
    
    {/exp:rss:feed}
  • #4 / Apr 17, 2008 5:54pm

    Ingmar

    29245 posts

    I am sorry, where exactly are you using that plugin in your template? On which custom field? {my_weblog_custom_field}?

  • #5 / Apr 17, 2008 6:47pm

    imagi-nation

    60 posts

    Yes, on {my_weblog_custom_field}. This is just for example, the real name is different.

  • #6 / Apr 17, 2008 6:53pm

    Ingmar

    29245 posts

    But I see no trace of it in the template, this is why I am asking. You only use {exp:xml_encode}.

  • #7 / Apr 17, 2008 7:20pm

    imagi-nation

    60 posts

    I posted the original RSS code. But I know where is the error. On the plugin page is an example and I copied it with little a modification. But the example have 2 lines inversed.

    Original example (with error)
    <content:encoded>
    href=’{title_permalink=weblog/comments}’>MORE…</a>”}{body}{/exp:word_limi
    <![CDATA[{exp:word_limit_plus if_exceeds="600" stop_after="500" the_link="<a
    t_plus}]]>
    </content:encoded>

    Correct example (whitout error)
    <content:encoded>
    <![CDATA[{exp:word_limit_plus if_exceeds="600" stop_after="500" the_link="<a
    href=’{title_permalink=weblog/comments}’>MORE…</a>”}{body}{/exp:word_limit_plus}]]>
    </content:encoded>

    The correct version work as it should, except the link and the word “MORE”. I hope I will figure out.

  • #8 / Apr 17, 2008 7:38pm

    Sue Crocker

    26054 posts

    imagi-nation, it does look like the example is off. I’ll see about getting a better one up there. Thanks for reporting it.

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

ExpressionEngine News!

#eecms, #events, #releases