Jump to content

Limit or truncate RSS output?


xtech

Recommended Posts

Hi,

i have a pages database, and i would like RSS feeds to only export a bit of the content. Yet they are exporting the whole content, which makes it easier to loose visitors.

Does anyone knows how to limit/truncate the RSS output?

Thank you in advance.

Link to comment
Share on other sites

Don't know if you could edit the generated output of feed rss but you could use this code if possible.

$text = $record->truncated();
$cc = mb_strlen($text);
$max_char = 500;
$truncated = mb_substr($text,0,($cc <= $max_char ? $max_char : mb_strrpos($text, " ",  -($cc - $max_char))));

if the content don't have space inside $truncated will empty.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...