• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Add the content type and content id to the bbCode States array

xf_phantom

Well-known member
#1
It would be nice, if you would add the content type and content id to the bbCodeOptions States array.

The problem with your current implemention is, that you're setting the contentType and contentIdKey in the extraOptions array, but they aren't available in the parser, only the states array is available, that's why it would be nice to have the contenttype and id there too.

I have an addon extending the parser and there i need to know the content type.
ATM i had to extend the xf views and add the additional data to the states array
PHP:
  protected function _getBbCodeOptions($contentType, $contentIdFieldName, $canViewAttachments = true, $messageKey = 'message'){
        return  array(
            'states' => array(
                'viewAttachments' => $canViewAttachments,
                'contentType' => $contentType,
                'contentIdKey' => $contentIdFieldName,
            ),
            'contentType' => $contentType,
            'contentIdKey' => $contentIdFieldName,
            'messageKey' => $messageKey,
        );
    }
The easiest solution would be to add the data inside XenForo_ViewPublic_Helper_Message::getBbCodeWrapper to the states array, but i can#t do this with an addon because it's a static method
 
Last edited: