#StackBounty: #layout #template #magento2.2.6 override wysiwyg_images.files

Bounty: 50

I try to override Magento_Cms::browser/content/files.phtml but when i test , the block is dont display , and i dont know why

i have the next extructure

<Vendor>_<Module>
├── <Stuff>/
│   ├── etc/
│   │   ├── module.xml
│   ├── view/
│   │   ├── adminhtml/
│   │   │   ├── layout
│   │   │   │   ├── cms_wysiwyg_images_contents.xml
│   │   │   ├── templates   
│   │   │   │   ├── browser
│   │   │   │   │   ├── content
│   │   │   │   │   │   ├── files.phtml
│   │   │   ├── web 
│   │   │   │   ├── images  
│   │   │   │   │   ├── icon
│   │   │   │   │   │   ├── pdf.png
│   ├── registration.php/

cms_wysiwyg_images_contents.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <container name="root">
        <referenceBlock name="wysiwyg_images.files">
            <arguments>
                <argument name="template" xsi:type="string">Gamma_Pdf::browser/content/files.phtml</argument>
            </arguments>
        </referenceBlock>
    </container>
</layout>

files.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

 /** @var $block MagentoCmsBlockAdminhtmlWysiwygImagesContentFiles */

$_width  = $block->getImagesWidth();
$_height = $block->getImagesHeight();

?>
<?php if ($block->getFilesCount() > 0): ?>
    <?php foreach ($block->getFiles() as $file): ?>
    
escapeHtmlAttr($block->getFileId($file)) ?>">

escapeHtmlAttr($_height) ?>px;width:escapeHtmlAttr($_width) ?>px;"> getFileThumbUrl($file)):?> escapeHtmlAttr($block->getFileThumbUrl($file)) ?>" alt="escapeHtmlAttr($block->getFileName($file)) ?>"/>

getFileWidth($file)): ?> escapeHtml($block->getFileWidth($file)) ?>xescapeHtml($block->getFileHeight($file)) ?> escapeHtml(__('px.')) ?>
escapeHtml($block->getFileShortName($file)) ?>
<?php endforeach; ?> <?php else: ?>
escapeHtml(__('No files found')) ?>
<?php endif; ?>

i use “magento/product-community-edition”: “2.2.6”

any suggestion ?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.