Closed (works as designed)
Project:
Leech
Version:
5.x-1.x-dev
Component:
General
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 May 2007 at 09:44 UTC
Updated:
30 Jul 2008 at 05:12 UTC
I'm not sure if this is really a leech question or a drupal question, but I want to cut the posted articles on my site to say around 200 words... Is there a way to limit the text but to also make sure that the text is ended at the end of a sentence, and not in the middle of a sentence?
Also, how to add a 'read more' link directly at the end of the node content, so users can rad the original article directly at the end of the (trimmed) node content?
Any ideas how to achieve this?
Thanks,
Patchak
Comments
Comment #1
alex_b commentedleech should do whatever your drupal site wide settings for teasers are. including a read more link.
Comment #2
patchak commentedHey Alex, thanks for the quick response... But I was talking about the full node view and not about the teaser...
The are some sites where I would need to limit the actual node content to a certain post and the plug in a link to the original article directly at the end of the text... is there any way to do this, while making sure the text is cut at the end of a sentence?
Thanks
Comment #3
patchak commentedI guess this is going to turn as a feature request. It would be nice to have a feature when you can decide for a maximum length for the full node content. After the text is trucated, there would be a link to 'read the original article' that would open up the article source in a new window. This is useful because sometimes bloggers don't want to subscribe to a public aggregator if the full feeds are published completely.
If you are not interested in adding this to a new version of leech, could you please give some tips and point me to the right direction on how I could patch the module to make it work that way?
I would then submit a patch that would add this feature as an option.
Thanks
Comment #4
alex_b commentedhi patchak,
sorry, I did not understand your request in the beginning.
you would need to truncate the body on hook_nodeapi($op = 'view', $teaser = FALSE) (pseudocode, see nodeapi documentation) and tack a "Go to original article" link onto the end of the body. You can find where the original article link sits on the $node object when viewing the node on the "devel render" tab.
alex
Comment #5
dankey commentedAlso I am interested to limit the size of a node, someone has made this feature?
Comment #6
alex_b commentedComment #7
alex_b commentedMore descriptive title.
Comment #8
alex_b commentedThis is a task for a custom or another contrib module. Won't get into leech.
Comment #9
giorgio79 commentedhttp://drupal.org/project/maxlength