Scandal
Well-known member
This is from template thread_preview:
My question is: how could I trim the [ quote ] bbcode from it? I mean anything [ quote ] tag with its contents.
I could extend the Pub which doing this if needed (php code). This is:
HTML:
{{ bb_code($firstPost.message, 'post:thread_preview', $firstPost, {
'lightbox': false
}) }}
I could extend the Pub which doing this if needed (php code). This is:
PHP:
public function actionPreview(ParameterBag $params)
{
$thread = $this->assertViewableThread($params->thread_id, ['FirstPost']);
$firstPost = $thread->FirstPost;
$viewParams = [
'thread' => $thread,
'firstPost' => $firstPost
];
return $this->view('XF:Thread\Preview', 'thread_preview', $viewParams);
}