Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

17480 Posts in 4474 Topics by 1973 members

Archive

SilverStripe Forums » Archive » RSS Feed Show First Paragraph Only?

Our old forums are still available as a read-only archive.

Page: 1
Go to End
Author Topic: RSS Feed Show First Paragraph Only? 560 Views
  • 3dkiwi
    avatar
    Community Member
    15 posts

    RSS Feed Show First Paragraph Only? Link to this post

    Guys

    I am implementing the RSS Feed as per the tutorial stage II but with some of my own modifications. eg. changing the DataObject::get to get the last 20 edited pages of a particular page type: DataObject::get("TipPage", "", "LastEdited DESC", "", "20"); This is working well.

    However I would like to only show the first paragraph of each of the returned page in the RSS. I know there is a function on the $Content within the Newsletter stuff which I have used for that part of the website but do not see any similar function for the RSS Feed.

    Any hints, please...

    3d

  • -- subsonic Superstar --
    avatar
    Community Member
    9 posts

    Re: RSS Feed Show First Paragraph Only? Link to this post

    I need to do this as well. Currently my RSS feed is showing the entire article (Content), and I haven't been able to figure out how to truncate it in the feed.

    This is how I'm generating the feed...

    // RSS
          function init() {
             RSSFeed::linkToFeed($this->Link() . "rss");
             parent::init();
          }

          function rss() {
             $rss = new RSSFeed($this->LatestUpdates(), $this->Link(), "A Word From Steve", "", "Title", "Content");
             $rss->outputToBrowser();
          }

          function LatestUpdates() {
             // 5 is the number of items listed
             return DataObject::get("StevesArticlesPage", "", "Created Desc", "", 5);
          }

    Any suggestions?

    Thanks,
    Clint

    560 Views
Page: 1
Go to Top

Currently Online: entercow

Welcome to our latest member: marcusl

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.