Insert a PDF button on WYSIWYG

edited October 2011 in Feature Requests
Is there a way to add a PDF insert button to the WYSIWYG that does the exact same thing as the insert image button does? I would like to allow other users to upload PDF files via the Assets panel, and then insert those PDF files using the WYSIWYG for the pages in the site.

Thanks
Erik

Comments

  • edited 4:05PM
    Are you using markItUp! or CKeditor for your WYSIWYG editor?

    If markItUp!, there is a fuel/modules/fuel/assets/js/editors/markitup/jquery.markitup.set.js file that allows you to change the buttons for your textareas.

    For CKeditor, there is a filemanager plugin that works pretty well for browsing files (it actually can be tweaked to use outside of CKeditor by itself with FUEL). We usually install the folder in the fuel/modules/fuel/assets/js/editors/ckeditor/ folder and change scripts/filemanager.config.js file to point to the assets folder:
    http://github.com/simogeo/Filemanager/archives/master

    Also, if you have a field with a class parameter of "asset_select pdf", a text form field will be created with a button to select from the assets/pdf folder:
    function form_fields($values = array(), $related = array()){ ... $form['my_field']['class'] = 'asset_select pdf'; ... }
  • edited October 2013
    Sorry for bumping a really old thread, but I found it from a Google search on getting PDF files in the ckeditor link dropdown. It took awhile of going through the source code to find the answer and wanted to share it in case someone else finds this thread.

    To get PDFs in the drop down along with the pages of the site, I had to add the data attribute 'link_pdfs' to the form field with the wysiwyg.
    
    'body' => array('data'=>array('link_pdfs'=>'true'), 'label' => lang('layout_field_body'), 'type' => 'textarea', 'description' => lang('layout_field_body_description')),
    
Sign In or Register to comment.