XF 2.2 How to use the attachment system

Taylor J

Well-known member
I've been trying to reverse engineer how to get the attachment system working with my blog addon for the past couple of days to no avail which is due to me taking extended breaks in creating this due to work and prepping for a out of state move.

So far I've added this to my controller
PHP:
/** @var \XF\Repository\Attachment $attachmentRepo */
            $attachmentRepo = $this->repository('XF:Attachment');
            $attachmentData = $attachmentRepo->getEditorData(
                'blogPost',
                $blogPost
            );
(I'm also assuming I have the $params->blog_id wrong and that needs to most likely be post_id for a blogs individual posting)

Which gives me an error on the "editor" page of
InvalidArgumentException: No attachment handler found for content type 'blogPost' in src/XF/Repository/Attachment.php at line 18

Now for one I am not at all sure how to even create a new content type or the actual handler for it, nor am I even sure I am headed in the right direction with this. I'm thinking I need to extend a class but can't determine which one to even do that to to create a new content type / handler.
 
Top Bottom