Nerbert
Active member
I'm working on a project in which I want to put a file upload button in the topctrl position on the PAGE_CONTAINER template. I have the button in place but it's missing many of the data-xxxx attributes, in particular, those supplied by XenForo_Model_Attachment->getAttachmentConstraints(). These values are available to my main template but apparently not to PAGE_CONTAINER.
The button is based on the "Upload a File" button in the reply form. I'm using the template_create event and the following code
attachment_handler_upload is my template for the button based on attachment_upload_button template.
How do I make these param values available to PAGE_CONTAINER
The button is based on the "Upload a File" button in the reply form. I'm using the template_create event and the following code
Code:
public static function template_create(&$templateName, array &$params, XenForo_Template_Abstract $template)
{
if($templateName == 'PAGE_CONTAINER')
{
$template->preloadTemplate('attachment_handler_upload');
$uploadButton = $template->create('attachment_handler_upload', $template->getParams());
$params['topctrl'] = $uploadButton->render();
}
}
attachment_handler_upload is my template for the button based on attachment_upload_button template.
How do I make these param values available to PAGE_CONTAINER