HeadHodge
Active member
In my view I'm trying render a single post (an array of one).
Here is the code I'm using:
It renders the BBCodes and Images just fine, but won't render attachments. I'm probably just missing something simple, but I can't figure out what. Any ideas?
Here is a sample of one of my pages (you can see the attachments are rendered as links instead of images):
This is what it should look like:
Here is the code I'm using:
Code:
//*****************
//** Render Post **
//*****************
public function renderPost(&$posts, &$shared)
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', ['view' => $this]));
$bbCodeOptions = array(
'states' => ['viewAttachments' => true],
'contentType' => 'post',
'contentIdKey' => 'post_id'
);
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($posts, $bbCodeParser, $bbCodeOptions);
$viewParams = array(
'post' => $posts[0],
'member' => $shared['member'],
);
$templateName = $shared['templatePrefix'].'_Detail';
$content = $shared['public']->createTemplateObject($templateName, $viewParams)->render();
return $content;
}
It renders the BBCodes and Images just fine, but won't render attachments. I'm probably just missing something simple, but I can't figure out what. Any ideas?
Here is a sample of one of my pages (you can see the attachments are rendered as links instead of images):
This is what it should look like:
Last edited: