Hi - I have created a view which creates a RSS feed - what I would like to do is cut off the text at 250 characters. Is this possible and if so, how?

Thank you in advance!

Comments

allen074’s picture

any help is greatly appreciated - thanks

Gemma Morton’s picture

My quickest (though untested) solution would be to make your View a List view. Install the Views Theme Wizard. When in admin/build/views click Theme Wizard. Over there, select Simple List, and your View, click: Select Theme Fields (I think - cant exactly recall). How, I know I got this right, is that a page is brought up with 3 boxes with Code inside. One for your template.php file, one for .css file, and another which says: views-list-your-view_name-here.tpl.php Copy the relevant code to the relevant files (the css and tpl.php you'll have to create as new files)

Then, where you have your "text with 250 characters" lets call is a Body field. Do a PHP string replace (http://www.php.net/manual/en/function.substr.php). I think thats right, although I am only starting on PHP coding myself.

allen074’s picture

thank you! but this is way too complicated for me unfortunately - i am a bit shocked that there's no way to create a simple rss feed based on a category that snips at 250 chars... while i absolutely love drupal, sometimes there's just things that make me frustrated :)

allen074’s picture

in case anyone is wondering - what i did was create the view with the full content - then use feedburner to strip the feed to 250 chars - bit of a half-arse solution but it works!