While the Wysiwyg editor built-in to Magento is great, especially not having to install a wysiwyg module for every Magento installation, it lacks in any way to configure it. I am kind of shocked by this, but, that’s just the way it is right now (at least as of 184.108.40.206 currently).
If you want to be able to upload other types of files besides the few limited image types and media types, I’ll walk you through the ‘right’ way to do it, without modifying core code. We are going to make a very simple module with just 2 files. Here’s how you do it:
Create this file: app/code/local/Prattski/WysiwygFiles/etc/config.xml with the following code:
<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Prattski_WysiwygFiles> <version>1.0.0</version> </Prattski_WysiwygFiles> </modules> <adminhtml> <cms> <browser> <extensions> <allowed> <jpg>1</jpg> <jpeg>1</jpeg> <png>1</png> <gif>1</gif> <pdf>1</pdf> </allowed> </extensions> </browser> </cms> </adminhtml> </config>
This configuration file will just build off of Magento’s configuration file, adding allowed extensions (the original configuration file is app/code/core/Mage/Cms/etc/config.xml). As you can see, I added pdf as an allowed extension. Just follow the same format for other extensions if you’d like to add more.
Create the following file: app/etc/modules/Prattski_WysiwygFiles.xml with the following code:
<?xml version="1.0"?> <config> <modules> <Prattski_WysiwygFiles> <active>true</active> <codePool>local</codePool> </Prattski_WysiwygFiles> </modules> </config>
This is what enables the module and allows Magento to recognize it’s there and active.
Once that is done, you should see the module listed in System >> Configuration >> Advanced, and it should work immediately. Enjoy!