Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 12:22:31 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155533 Posts in 21713 Topics by 7738 Members
Latest Member: Pattieardathfe
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: News Reader module - how to truncate posts?  (Read 736 times)
PJW

Offline Offline

Posts: 31


« on: September 24, 2009, 03:47:56 PM »

Hi,

I have the newsreader Module by Robert Hase from this page: http://addons.websitebaker.org/pages/modules/page-modules.php installed.  It's working well.

I've also managed (with some pointers to relevant topics here) to get the feed to display in the right (3rd) column of my template (instead of the main content section).

As there's obviously less space there than in the middle I'd like to be able to limit the number of words/characters displayed before a post is truncated.

This is obviously configured somewhere because some posts are truncated, they are displayed with [...] at the end of the post, indicating that there's more to read.

However I can't find where it is configured, whether in the module itself or in the original feed?  Also I can't find a pattern in the number of words or characters that are displayed before the [...]

Any help would be great Smiley
Logged

Paul
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #1 on: September 24, 2009, 06:12:37 PM »

If it is not in the settings of the module (I don't use it) then you'll need to hack the module.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

PJW

Offline Offline

Posts: 31


« Reply #2 on: September 24, 2009, 06:23:55 PM »

Thanks for your reply Klaus.

Yes, that's what I'm asking for some help with.  I'm not sure where to start, or indeed if I should be starting with the newsreader module, or if it actually doesn't control it at all and the posts are truncated at source.

Actually, I've just checked by going directly to the feed URL in Firefox, and I think it's the original feed that's truncated, so although it would be good to be able to do it in News Reader (and I'm still interested in fing a way to do it), I think I may need to look for a way to do this in WordPress, which is the platform for the blog I'm linking to.

BFN,
Logged

Paul
WebBird
Guest
« Reply #3 on: September 24, 2009, 06:42:47 PM »

However I can't find where it is configured, whether in the module itself or in the original feed?  Also I can't find a pattern in the number of words or characters that are displayed before the [...]

I think it's in the feed, not in the module.

Here's a function to truncate text: http://snippets.dzone.com/posts/show/7125
Logged
PJW

Offline Offline

Posts: 31


« Reply #4 on: September 24, 2009, 10:28:57 PM »

Thanks WebBird,

That looks useful, I'll make a note of it.

As I have control over the source RSS feed in this instance (it's my WP blog) I found out how to truncate at source.

For anyone interested, it was just a case of reducing the number of words at the relevant place in wp-includes\formatting.php.

BFN,
Logged

Paul
WebBird
Guest
« Reply #5 on: September 25, 2009, 09:38:47 AM »

Nice to hear that you solved your issue. grin

BTW, the truncate-Function is included in Anynews now. Seems to work fine.
Logged
PJW

Offline Offline

Posts: 31


« Reply #6 on: September 25, 2009, 09:57:32 AM »

Ah, I see you are maintaining Any news.

I used News Reader because I wanted to display the feed from an external website, but does Any news do this too?  I assumed that Any news was just for the WB news module when I read the description...
Quote
The function can be used to display news entries from the WebsiteBaker News module

?
Logged

Paul
WebBird
Guest
« Reply #7 on: September 25, 2009, 10:01:21 AM »

I used News Reader because I wanted to display the feed from an external website, but does Any news do this too?  I assumed that Any news was just for the WB news module when I read the description...

You're right! I just wanted to mention that the function I linked above seems to work fine. (If someone wants to use it, too.) I did not want to say that Anynews would be an alternative to Newsreader. Sorry for the confusion. rolleyes
Logged
PJW

Offline Offline

Posts: 31


« Reply #8 on: September 25, 2009, 10:05:49 AM »

No problem.  Thanks for the clarification.  I know I will have reason to install Any news in the future, so I look forward to trying it out smiley
Logged

Paul
WebBird
Guest
« Reply #9 on: September 25, 2009, 10:22:04 AM »

I really did not want to advertise Anynews. grin Was just meant as a "progress report" concerning the truncate code in the link. rolleyes
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!