Jaxel
Well-known member
Working on my wiki software right now. Wiki pages can have their own attachments in my software. I've imported the data from the XF1 version, so my pages already have attachments linked to them.
First I get my page:
Then I fetch attachments linked to said page, and hydrate the relations:
This clearly works, as when I dump the $wiki variable, I can see the attachment relations.
However, if I then parse the bb_code:
Instead of getting nice thumbnails where the
What am I forgetting here?
First I get my page:
Code:
$wiki = $this->assertPageExists($params->page_slug, ['Thread']);
Then I fetch attachments linked to said page, and hydrate the relations:
Code:
$attachments = $this->finder('XF:Attachment')
->where('content_type', 'ewr_carta_page')
->where('content_id', $wiki->page_id)
->order('attach_date')
->fetch();
$wiki->hydrateRelation('Attachments', \XF::em()->getBasicCollection($attachments->toArray()));
However, if I then parse the bb_code:
Code:
$html = \XF::app()->bbCode()->render($wiki->page_content, 'html', 'ewr_carta_page', $wiki);
\XF::dump($html);
Instead of getting nice thumbnails where the
[ATTACH]###[/ATTACH]
should be, I am getting generic View attachment ###
links.What am I forgetting here?