OC v3.х Как подключить ckeditor на опенкарт3 для других модулей?

  • Автор темы Автор темы labirint
  • Дата начала Дата начала

labirint

Разрушитель (V)
Сообщения
129
Реакции
25
Баллы
89
Имеется установленный ckeditor. Функционирует как нужно, но не везде. Как подключить ckeditor к шаблону unishop2 на опенкарт 3, а именно к блогу и новостному модулю?
 
Смотрим контролеры и twig-и блога.
Смотрим ocmod модуля ckeditor и правим по аналогии с товаром
XML:
  <file path="admin/controller/catalog/product.php">
    <operation>
      <search><![CDATA[public function add() {]]></search>
      <add position="after">
        <![CDATA[        $this->document->addScript('../admin/view/javascript/ckeditor/ckeditor.js');
        $this->document->addScript('../admin/view/javascript/filemanager.js');
        $this->document->addScript('../admin/view/javascript/jquery/jquery.fancybox.min.js');
        $this->document->addStyle('../admin/view/stylesheet/jquery.fancybox.min.css');]]>
      </add>
    </operation>
    <operation>
      <search><![CDATA[public function edit() {]]></search>
      <add position="after">
        <![CDATA[        $this->document->addScript('../admin/view/javascript/ckeditor/ckeditor.js');
        $this->document->addScript('../admin/view/javascript/filemanager.js');
        $this->document->addScript('../admin/view/javascript/jquery/jquery.fancybox.min.js');
        $this->document->addStyle('../admin/view/stylesheet/jquery.fancybox.min.css');]]>
      </add>
    </operation>
  </file>
  <file path="admin/view/template/catalog/product_form.twig">
    <operation>
      <search><![CDATA[<textarea name="product_description[{{ language.language_id }}][description]" placeholder="{{ entry_description }}" id="input-description{{ language.language_id }}" data-toggle="summernote" data-lang="{{ summernote }}" class="form-control">{{ product_description[language.language_id] ? product_description[language.language_id].description }}</textarea>]]></search>
      <add position="replace">
        <![CDATA[<textarea name="product_description[{{ language.language_id }}][description]" placeholder="{{ entry_description }}" id="input-description{{ language.language_id }}" data-toggle="ckeditor" class="form-control">{{ product_description[language.language_id] ? product_description[language.language_id].description }}</textarea>]]>
      </add>
    </operation>
    <operation>
      <search><![CDATA[<td class="text-left"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="{{ thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>]]></search>
      <add position="replace">
        <![CDATA[<td class="text-left"><a href="" id="thumb-image" data-toggle="filemanager" class="img-thumbnail"><img src="{{ thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" width="100" height="100" /></a>]]>
      </add>
    </operation>
    <operation>
      <search><![CDATA[function addImage() {]]></search>
      <add position="replace" offset="2">
        <![CDATA[function addImage() {
    html  = '<tr id="image-row' + image_row + '">';
     html += '  <td class="text-left"><a href="" id="thumb-image' + image_row + '"data-toggle="filemanager" class="img-thumbnail"><img src="{{ placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" width="100" height="100" /></a><input type="hidden" name="product_image[' + image_row + '][image]" value="" id="input-image' + image_row + '" /></td>';]]>
      </add>
    </operation>
    <operation>
      <search><![CDATA[<td class="text-left"><a href="" id="thumb-image{{ image_row }}" data-toggle="image" class="img-thumbnail"><img src="{{ product_image.thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>]]></search>
      <add position="replace">
        <![CDATA[<td class="text-left"><a href="" id="thumb-image{{ image_row }}" data-toggle="filemanager" class="img-thumbnail"><img src="{{ product_image.thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" width="100" height="100" /></a>]]>
      </add>
    </operation>
  </file>
 
Назад
Верх