Skip to content

Instantly share code, notes, and snippets.

@Sental
Created June 12, 2022 17:56
Show Gist options
  • Save Sental/b4a713cf0e98d633acaca42dfb0e21cb to your computer and use it in GitHub Desktop.
Save Sental/b4a713cf0e98d633acaca42dfb0e21cb to your computer and use it in GitHub Desktop.
Create Media Gallery Folders in Root Media Folder for Magento 2.4.3-p1 and later releases
<?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 -->
<folder_one>folder_one</folder_one>
<reddit>reddit</reddit>
<secrets>secrets</secrets>
</media_gallery_image_folders>
</allowed_resources>
</media_storage_configuration>
</system>
</default>
</config>
<!-- file location
app/code/Vendor/Module/etc/config.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" />
</config>
<!-- file location
app/code/Vendor/Module/etc/module.xml -->
<?php
//Standard Registration Module
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_Module',
__DIR__
);
//file location
//app/code/Vendor/Module/etc/module.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment