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

alex_b’s picture

Status: Active » Closed (fixed)

leech should do whatever your drupal site wide settings for teasers are. including a read more link.

patchak’s picture

Status: Closed (fixed) » Active

Hey 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

patchak’s picture

I 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

alex_b’s picture

hi 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

dankey’s picture

Also I am interested to limit the size of a node, someone has made this feature?

alex_b’s picture

Category: support » feature
alex_b’s picture

Title: How to limit the size of a node? » Limit the maximum text length of node body
Version: 5.x-1.6 » 5.x-1.x-dev

More descriptive title.

alex_b’s picture

Status: Active » Closed (works as designed)

This is a task for a custom or another contrib module. Won't get into leech.

giorgio79’s picture

Title: Limit the maximum text length of node body » Limit the maximum text length of node body