Insert a PDF button on WYSIWYG
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
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'; ... }
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.