XF 2.2 How to display posts (not raw $post.message) ?

Anatoliy

Well-known member
I fetch soft deleted posts with a finder and pass to a template, where with <xf:foreach loop="$posts" value="$post"> display {$post.message}. It works, but when a message has a quotation, pix, links, it looks quite messy.

Is there some easy way to display them "pretty"? Say xf_render_post($post.message) or <xf:post value="$post.message" /> ?

Thanks in advance.
 
{{ bb_code($post.message, 'post', $post) }}
How this is built ?
I have an option named footerProCol1_title1 and and I would like the text filled in its field to be rendered in HTML, how should I go about it?

What are the second and third parameter in this syntax ?
Code:
{{ bb_code($option.footerProCol1_title1, 'xxxxx', $xf-xxxxx) }}

Thank you.
 
XF\Template\Templater.php
PHP:
public function fnBbCode($templater, &$escape, $bbCode, $context, $content, array $options = [], $type = 'html')

$templater and $escape are "internal" parameters used by the templater, the remaining parameters can be used from templates.

Eg. with the above example
$post.message = $bbCode, 'post' = $context and , $post = $content
 
Back
Top Bottom