0

No folders show up in wysiwig interface in 2.4.3-p3

I have read this --> https://developer.adobe.com/commerce/php/tutorials/backend/modify-image-library-permissions/ and this --> Media folders missing from admin in 2.4.3-p3 update

Does anyone know exactly where to add the new config.xml file to be able to see the images and folders in the CMS media library tool?

Inside my directory at /public_html/app/code there are 2 directorys. Mageplaza and Smartwave.

/public_html/app/code/Mageplaza
/public_html/app/code/Smartwave

Where should I put the new config.xml? Do I have to create a new directory or put it in an existing one?

If I'm adding a configuration for the media viewer in the CMS would I have to create a directory path that emulates one from another location?

I'm completely confused here. Can some please tell me the exact path? Like, pretend I don't know anything about Magento! lol

Also, do I need to use this code over and over for each new directory inside the wysiwig directory or does it cover all the new directories I create?

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
   <default>   
      <system>
         <media_storage_configuration>
            <allowed_resources>
               <media_gallery_image_folders>
                  <!-- new "Media Gallery Allowed" folders -->
                  <my_image_folder>wysiwyg</my_image_folder>
                  <my_catalog_image_folder>media/wysiwyg</my_catalog_image_folder>
               </media_gallery_image_folders>
            </allowed_resources>
         </media_storage_configuration>
      </system>
   </default>
</config>

1 Answer 1

0

app/code/Mageplaza and app/code/Smartwave are vendor directories for third-party extensions.
You should create a new custom module within your vendor directory. You can use your company, project, or even your name as the vendor name.

In this post, I'll use Magetu as the vendor name.
Since this configuration (media library folder permissions) is related to the Magento_Cms module, I'll set the name of my custom module as Cms.

Here are the steps to create the custom module and deploy the changes:

Step 1: Create the registration.php:
File path: app/code/Magetu/Cms/registration.php

<?php

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magetu_Cms', __DIR__);

Step 2: Create the module.xml:
File path: app/code/Magetu/Cms/etc/module.xml

<?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="Magetu_Cms">
        <sequence>
            <module name="Magento_Cms"/>
        </sequence>
    </module>
</config>

Step 3: Create the config.xml file:
File path: app/code/Magetu/Catalog/etc/config.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <system>
            <media_storage_configuration>
                <allowed_resources>
                    <media_gallery_image_folders>
                        <!-- new "Media Gallery Allowed" folders -->
                        <mageplaza_image_folder>mageplaza</mageplaza_image_folder>
                        <your_image_folder>your_image_folder</your_image_folder>
                    </media_gallery_image_folders>
                </allowed_resources>
            </media_storage_configuration>
        </system>
    </default>
</config>

Step 4: Deploy the changes:

bin/magento setup:upgrade
bin/magento setup:di:compile

If you are in the production mode, you'll need to deploy static content.


  • If you want to allow any directories within the wysiwyg directory, declare them in the config.xml file.

  • If multiple modules contain images within wysiwyg directory, you can add them all within a single module.

  • If you want to allow a specific image directory for a specific module, you can use the config in its respective module. For example, if the module is Magetu_Catalog, the config file path should be: app/code/Magetu/Catalog/etc/config.xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.