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?
I have an RSS feed I want to sue but the feed gives the FULL TEXT of the article instead of a snippet.
|
I'm looking for it, too. Have you got any clues? Cheers from Brazil, Felipe |
editing the file "plugins/jquery/jquery.jfeed.js" may fix your problem. ---- |
im not really seeing anywhere in that file that pretains to character length.... |
|
I just looked through that file and couldn't find any character settings. anyone? |
This post was edited to remove a solution that did not work -- read down further for the fix to this isse. |
Thanks coach! Unfortunately I got this error... Parse error: syntax error, unexpected T_IF in /home/gradmin/public_html/inc/classes/BxRSS.php on line 72 |
This post was edited to remove a solution that did not work -- read down further for the fix to this isse.
|
It was missing a - ; at the end if summary. I put that in and the page loads but the text isn't truncated. |
This post was edited to remove a solution that did not work -- read down further for the fix to this isse.
|
Should have crossed your toes too. Didn't work, still showing all. |
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 |
Thanks for working on this! Much appreciated. |
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 |
Nope... didnt work!
Give me a sec... |
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? |
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!
D |
Nope, the new code doesn't work. |
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! |
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 |
yup that should do it! |
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 |
I'm sure there will be plenty of members very grateful to you for solving this. A job well done! |
It's working great on my two sites!
Many thanks,
Stuart There are none so blind as those that will not see. |
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 |
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! |
it works thank you so much guy |
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? |
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 |