XF 2.0 Getting attachments to show up in bbcode?

Jaxel

Well-known member
I am fetching a bunch of threads (through another entity).
Code:
$articles = $this->finder('EWR\Porta:Article')->with('Thread')->fetch();


I am then iterating through the threads and printing out the content of the first post of each thread:
Code:
    <xf:foreach loop="$articles" value="$article">
        {{ bb_code($article.Thread.FirstPost.message, 'post', $article) }}
    </xf:foreach>

While the code properly parses the BbCode; it doesn't parse the attachments. Instead it just says View attachment 1, with a link.

How do I parse the bbcode for attachments?
 
Probably this works
Code:
    <xf:foreach loop="$articles" value="$article">
        {{ bb_code($article.Thread.FirstPost.message, 'post', $article.Thread.FirstPost) }}
    </xf:foreach>
 
  • Like
Reactions: LPH
Probably this works
Code:
    <xf:foreach loop="$articles" value="$article">
        {{ bb_code($article.Thread.FirstPost.message, 'post', $article.Thread.FirstPost) }}
    </xf:foreach>
Ooooh... so simple!

XF1 was super complicated when it came to preparing attachments for posts.
 
Back
Top Bottom