V
V
Vladimir2014-09-19 13:24:35
Drupal
Vladimir, 2014-09-19 13:24:35

How to force views to truncate the body field to the first dot?

I output the body field through views, specify a truncated text of 150 characters in the field settings, the number of characters decreases in the view output, but the fact is that sometimes views cuts off the last word at the end of the text, and it does not look neat. Tell me how you can truncate the body to the first point, i.e. the sentence? I noticed on many other Drupal sites that their text is cut off after the first sentence.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
andead, 2014-09-21
@seoyuzer

Redefine the views field template. Well, in it instead of "print $output;"
print current(explode('.', $output));

D
Drupby, 2014-09-19
@drupby

I noticed on many other Drupal sites that their text is cut off after the first sentence.

They obviously have "Summary or trimmed text" selected for formatting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question