I'm new so I don't know how things really work here but I'm going to give it a try :
I would like to know if there's a way to insert a PDF link in an FAQ widget. I used HTML coding in the WYSIWYG (am I correct?) with the code "<"a href=''>" but it did not work out.
Could you help me, please?
Thanks.
Adrien.
1 Answer 1
By default, Magento has some file restrictions for the WYSIWYG editor. You can add PDF as file extension with the following DI snippet:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
<arguments>
<argument name="extensions" xsi:type="array">
<item name="allowed" xsi:type="array">
<item name="pdf" xsi:type="number">1</item>
</item>
<item name="image_allowed" xsi:type="array">
<item name="pdf" xsi:type="number">1</item>
</item>
</argument>
</arguments>
</type>
</config>
You will find the di.xml like so:
MODULE_VENDOR/MODULE_NAME/etc/di.xml
or:
MODULE_VENDOR/MODULE_NAME/etc/adminhtml/di.xml