Jump to content

Медиазагрузчик в комментариях


AHristich

Recommended Posts

Люди добрые,подскажите,пожалуйста. Есть статьи на сайте (на основе Pages),естественно у них имеются комментарии. Всю админку облазил но так и не нашел,где можно отключить возможность загрузки файлов при добавлении комментариев.

1044291487_2022-09-2015-51-01.png.538a1d69657540abd74ec68e4b7b0050.png

Повторюсь что отключить/убрать надо ТОЛЬКО при добавлении комментариев.

Link to comment
Share on other sites

Есть плагин для Галереи. Работает ли он сейчас, неизвестно. Но как старт для создания нового планина может подойти. 

 

Link to comment
Share on other sites

Через инспектор определил что вывод загрузчика выполняет шаблон editorAttachments.

    <div data-ipsEditor-toolList>
        {{$editorName = preg_replace( "/(.+?)_(\d+?)_$/", "$1[$2]", mb_substr( $name, 0, -7 ) );}}
        <div data-role='attachmentArea' data-controller='core.global.editor.uploader, core.global.editor.insertable' data-editorID='{$editorName}' class='ipsComposeArea_attachments ipsClearfix ipsAreaBackground_light ipsUploader ipsUploader--withBorder ipsUploader--insertable' id="{$name}_drop_{expression="md5( mt_rand() )"}" data-ipsUploader data-ipsUploader-dropTarget='#elEditorDrop_{$name}' data-ipsUploader-button='[data-action="browse"]' {{if $maxFileSize}}data-ipsUploader-maxFileSize="{expression="number_format( $maxFileSize, 3, '.', '' )"}"{{endif}} data-ipsUploader-maxChunkSize="{expression="number_format( $maxChunkSize, 3, '.', '' )"}" {{if $allowedFileTypes}}data-ipsUploader-allowedFileTypes='{expression="json_encode( $allowedFileTypes )"}'{{endif}} data-ipsUploader-name="{$name}" data-ipsUploader-key="{$pluploadKey}" {{if $multiple}}data-ipsUploader-multiple {{if $totalMaxSize}}data-ipsUploader-maxTotalSize="{expression="$totalMaxSize"}"{{endif}}{{endif}} {{if $minimize}}data-ipsUploader-minimized{{endif}} data-ipsUploader-insertable data-ipsUploader-postkey="{$editor}" data-ipsUploader-template='core.editor.attachments' {{if $value}}data-ipsUploader-existingFiles='{expression="json_encode( $existing )"}'{{endif}} {{if isset( $default )}}data-ipsUploader-default='{$default}'{{endif}} {{if $maxImageDims}}data-ipsUploader-maxImageDims="{$maxImageDims}"{{endif}} {{if $allowStockPhotos}}data-ipsUploader-allowStockPhotos="{$allowStockPhotos}"{{endif}}>
            <div class="ipsComposeArea_dropZone {{if $minimize}}ipsComposeArea_dropZoneSmall{{endif}} ipsClearfix" id='elEditorDrop_{$name}'> ....... </div>

На сайте (в статьях) при добавлении комментария data-editorID='{$editorName}' принимает значение data-editorid="content_record_form_comment_номерпоста" .

И вот как составить условие что если data-editorid="content_record_form_comment_номерпоста" то происходит какое-либо действие,ну в данном случае добавляется класс ipsHide.

Link to comment
Share on other sites

Zero108 благодарю за подсказку.Решил все так

в сss добавил

div[data-controller="core.front.core.commentsWrapper"] div[data-ipseditor-toollist] {display:none;}

теперь ,как и требовалось,при добавлении комментария (или ответе на коммент) загрузчик скрыт с глаз долой. В остальных местах отображается как и положенно.

941230086_2022-09-2111-42-37.png.d3693e66e9b84525545537e9793a7907.png

теперь буду дальше кумекать,как лучше реализовать все это.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Ваша ссылка была автоматически строена.   Отображать как обычную ссылку

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...