Magento 2 is not having this by default setting to see import folder of pub/media in ‘Insert Images’ section under CMS Page or Blocks.
If you want to show import folder in CMS Page or Blocks then follow below steps.
Step 1 : Create file : app/code/Magemonkey/ImportFolder/registration.php
1 2 3 4 5 6 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Magemonkey_ImportFolder', __DIR__ ); |
Step 2 : Create file : app/code/Magemonkey/ImportFolder/etc/module.xml
1 2 3 4 5 |
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magemonkey_ImportFolder" setup_version="1.0.0"> </module> </config> |
Step 3 : Create file : app/code/Magemonkey/ImportFolder/etc/di.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?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="dirs" xsi:type="array"> <item name="include" xsi:type="array"> <item name="import" xsi:type="array"> <item name="regexp" xsi:type="boolean">true</item> <item name="name" xsi:type="string">pub[/\\]+media[/\\]+import[/\\]*$</item> </item> </item> </argument> </arguments> </type> </config> |
Step 4 : Remove or comment .htaccess file under import folder
After that run below commands
– php bin/magento setup:upgrade
– php bin/magento setup:static-content:deploy
– php bin/magento cache:clean
Thats it.
Now clean cache and check in admin side under CMS Page or Blocks ‘Insert Images’ section. Import folder should be visible there.
You can also use this folder image in CMS Page or Blocks
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62837fecbc704530089045/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...