Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

preview_from_text()

Description

Generates preview text of a certain line length and count

Can be used for generating previews of text output, such as messages.

Parameters

ColumnTypeDefaultDescription
$text string The text to generate the preview of, can contain HTML
$line_length int The number of characters that the preview can have on each line
$line_count int The number of lines to be generated in the preview
$add_ellipsis bool Should ellipsis (...) be added if the original $text exceeds $line_count

Return

string Returns a string of the preview text, or an empty string if the preview is unable to be generated

This article was last updated 26th September 2025 15:05 Europe/London time based on the source file dated 26th September 2025 11:55 Europe/London time.