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

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

xf_phantom

Well-known member
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:
Upvote 2
This suggestion has been closed. Votes are no longer accepted.
Back
Top Bottom