Jump to content

Can I get the first paragraph of a record?


Gil Ronen

Recommended Posts

Posted

I want to make a template for the record feed that contains only the first ~50 words of the article, not the full text.

I know I can do 

{$record->truncated()|raw}

To get the entire record text, but can I get only a part of it?

Thanks.

Posted

So where exactly do you want to cut? After x characters? One paragraph? Can it cut words? …?

I recently used something like this to cut the text for meta tags. 

{{$previewtext=mb_substr(strip_tags($record->truncated()),0,255);}}
{$previewtext}

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...