Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 931 Vote(s) - 3.42 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to display a snippet of a field in Expression Engine

#1
I have a news section on my EE website where a user can add news articles.

The 3 last added articles will be displayed on the homepage with the News title, date and news body copy. Here's my code:

<ul>
{exp:channel:entries channel="news" status="Featured|open" disable="catergories|member_data|pagination" limit="3"}
<li>
<h3><a href="{title_permalink=site/news"}">{title}</a></h3>
<h4>{date}</h4>
<p>{body}</p>
</li>
{/exp:channel:entries}
</ul>

Is there a way I can limit the {body} copy to only display a set a number of characters, so it displays a snippet/section of the text rather than all of it?
Reply

#2
Take a look at the EE documentation section on [plugins available for download][1].

[1]:

[To see links please register here]


I think "Char Limit" would do what you want, alternatively look at "Word Limit".

Use like so:

{exp:char_limit total="100"}
{body}
{/exp:char_limit}

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through