RSS Feed Character Limit

I have an RSS feed I want to sue but the feed gives the FULL TEXT of the article instead of a snippet.

Is there any way to have a character or word limit set for RSS fees displayed on the dolphin homepage?

Quote · 2 Jun 2008

I'm looking for it, too. Have you got any clues?

Cheers from Brazil, Felipe

Quote · 13 Jun 2008

editing the file "plugins/jquery/jquery.jfeed.js" may fix your problem.

----
Quote · 14 Jun 2008

im not really seeing anywhere in that file that pretains to character length....

Quote · 5 Dec 2008


Same problem here...

Quote · 9 Dec 2008

I just looked through that file and couldn't find any character settings.  anyone?

Quote · 9 Dec 2008

This post was edited to remove a solution that did not work -- read down further for the fix to this isse.

Quote · 9 Dec 2008

Thanks coach!  Cool

Unfortunately I got this error...

Parse error: syntax error, unexpected T_IF in /home/gradmin/public_html/inc/classes/BxRSS.php on line 72

Quote · 9 Dec 2008

This post was edited to remove a solution that did not work -- read down further for the fix to this isse.

 

Quote · 9 Dec 2008

It was missing a - ; at the end if summary.  I put that in and the page loads but the text isn't truncated.

Quote · 9 Dec 2008

This post was edited to remove a solution that did not work -- read down further for the fix to this isse.

 

Quote · 9 Dec 2008

Should have crossed your toes too.  Didn't work, still showing all.

Quote · 9 Dec 2008

Hmmm...

 

Maybe I am in the wrong area entirely... perhaps I should play before I post... lol

 

Let me play around on a test site.. see if I can get it...  brb...

 

D

Quote · 9 Dec 2008

Thanks for working on this!  Much appreciated.

Quote · 10 Dec 2008

Fourth time is the charm.. or is the fifth... lol

 

Open /inc/js/jquery.dolRSSFeed.js


find:::

 

var item = feed.items[iItemId];

 

After it paste the following:::

 

var trunc = item.description;

var thelength = 15;

if (trunc.length > thelength) {

trunc = trunc.substring(0,thelength);

trunc = trunc.replace(/\w+$/,'');

trunc = trunc +'.....';

item.description = trunc;

}

 

Fingers crossed - as the test server went down before I tested (routine maintenance) so this has not been tested. I have to take care of a few maintenance tasks - but will check back to see whether this (finally) worked for us.

 

D

Quote · 10 Dec 2008

Nope... didnt work!

 

Give me a sec...

Quote · 10 Dec 2008
Awesome!!! It worked. Thanks so much. One little thing if it's do-able... Is there any way to get the first full sentence or two? right now it cuts out after 2 words. Is that asking too much?
Quote · 10 Dec 2008

That didnt work with the feeds I was testing with (containing HTML I think was the problem) - increase thelength = xxx and test it -- see if it is giving you enuf.

 

For feeds that contain HTML I found this works.

 

var trunc = item.description;

var thelength = 650; // change this value here until you get the look you want

if (trunc.length > thelength) {

trunc = trunc.substring(0,thelength);

trunc = trunc.replace(/\w+$/,'');

trunc = trunc +'.....<br>';

trunc.innerHTML = trunc;

}

 

I hope this does it!  Smile

 

D

Quote · 10 Dec 2008
Nope, the new code doesn't work.
Quote · 10 Dec 2008
Got it working! You can see it in action here... http://mygridironspace.com/viewPage.php?ID=AFC%20EAST I combined the two to make it work... var trunc = item.description; var thelength = 250; // change this value here until you get the look you want if (trunc.length > thelength) { trunc = trunc.substring(0,thelength); trunc = trunc.replace(/\w+$/,''); trunc = trunc +'.....'; item.description = trunc; } Thanks again! I owe you big time!
Quote · 10 Dec 2008

var trunc = item.description;

var thelength = 250; // change this value here until you get the look you want

 

if (trunc.length > thelength)

{

trunc = trunc.substring(0,thelength);

trunc = trunc.replace(/\w+$/,'');

trunc = trunc +'.....'; item.description = trunc;

}

 

Is that the finished code?? -- Just so others can change theirs if they need to.

 

I had forgotten to mention to change the item.description in the <div> couple lines down to

 

+ trunc +

 

instead of

 

+ item.description + 

 

Either way - I am glad (so very very glad) that we got it working for you.

 

Daniel

Quote · 10 Dec 2008

yup that should do it!

Quote · 10 Dec 2008

 

I dont know about you - but WHEW!!!

 

;)

 

I am SO not a javascript guy - so it was luck and chance we got it... lol

 

Time for a smoke and a coffee, both of us (should you be a smoker) - a reward for job well done and another forum question solved!

 

LOL

Quote · 10 Dec 2008

I'm sure there will be plenty of members very grateful to you for solving this.  A job well done!

Quote · 10 Dec 2008
It's working great on my two sites! Many thanks, Stuart
There are none so blind as those that will not see.
Quote · 10 Dec 2008

Stuart: Glad to hear it helped you as well.. I havent forgotten the other task.. my test server been going up and down all day -- new guy thinks its fun to reboot or something... but its my first task in the morning.

 

D

Quote · 10 Dec 2008

Fourth time is the charm.. or is the fifth... lol

Open /inc/js/jquery.dolRSSFeed.js


find:::

var item = feed.items[iItemId];

After it paste the following:::

var trunc = item.description;

var thelength = 15;

if (trunc.length > thelength) {

trunc = trunc.substring(0,thelength);

trunc = trunc.replace(/\w+$/,'');

trunc = trunc +'.....';

item.description = trunc;

}

Fingers crossed - as the test server went down before I tested (routine maintenance) so this has not been tested. I have to take care of a few maintenance tasks - but will check back to see whether this (finally) worked for us.

D

I was able to get it to work with the above code.... thanks guys, i would of never come up with that!

Quote · 10 Dec 2008

it works thank you so much guy

Quote · 5 Apr 2009

i have an opposite problem---my RSS content is not showing any of the content of a forum post.

it's only showing who posted--but not the first sentence of the post or not even a word...

any ideas where the issue may be?

Quote · 15 Apr 2011

 

var trunc = item.description;

var thelength = 250; // change this value here until you get the look you want

 

if (trunc.length > thelength)

{

trunc = trunc.substring(0,thelength);

trunc = trunc.replace(/\w+$/,'');

trunc = trunc +'.....'; item.description = trunc;

}

 

Is that the finished code?? -- Just so others can change theirs if they need to.

 

I had forgotten to mention to change the item.description in the <div> couple lines down to

 

+ trunc +

 

instead of

 

+ item.description + 

 

Either way - I am glad (so very very glad) that we got it working for you.

 

Daniel

 Daniel - thanks for posting a solution!  Works perfectly!

Cheers - Jethro

Quote · 24 Oct 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.