Jump to content
Sign in to follow this  
nash

Не подгружается ckeditor

Recommended Posts

Добрый день! Ни в какую не хочет подключаться ckeditor в ocstore 2.3 для новых полей.

 <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-seria_descrip<?php echo $language['language_id']; ?>"><?php echo $entry_seria_descrip; ?></label>
                    <div class="col-sm-10">
                      <textarea name="category_description[<?php echo $language['language_id']; ?>][seria_descrip]" placeholder="<?php echo $entry_seria_descrip; ?>" id="input-seria_descrip<?php echo $language['language_id']; ?>" data-lang="<?php echo $lang; ?>" class="form-control summernote"><?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['seria_descrip'] : ''; ?></textarea>
                    </div>
                  </div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-description<?php echo $language['language_id']; ?>"><?php echo $entry_description; ?></label>
                    <div class="col-sm-10">
                      <textarea name="category_description[<?php echo $language['language_id']; ?>][description]" placeholder="<?php echo $entry_description; ?>" id="input-description<?php echo $language['language_id']; ?>" data-lang="<?php echo $lang; ?>" class="form-control summernote"><?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['description'] : ''; ?></textarea>
                    </div>
                  </div>
  <script type="text/javascript"><!--
  <?php if ($ckeditor) { ?>
    <?php foreach ($languages as $language) { ?>
	    ckeditorInit('input-description<?php echo $language['language_id']; ?>', getURLVar('token'));
		ckeditorInit('input-seria_descrip<?php echo $language['language_id']; ?>', getURLVar('token'));
    <?php } ?>
  <?php } ?>
  //--></script>

Если подключать только к description, то подключается нормально. А если к двум, то выдает ошибку в консоле

Share this post


Link to post
Share on other sites

Какую ошибку выдает в консоли?

P.S.: Зачем в 2.3 использовать ckeditor? Есть же Summernote?

Share this post


Link to post
Share on other sites
Uncaught TypeError: Cannot read property 'getEditor' of undefined
    at a (ckeditor.js:322)
    at Object.CKEDITOR.replace (ckeditor.js:326)
    at ckeditorInit (ckeditor_init.js:3)
    at index.php?route=catalog/category/edit&token=jDDVk8DMvT4CECXzMhxHVmPglGBKqX2o&category_id=57:763
a @ ckeditor.js:322
CKEDITOR.replace @ ckeditor.js:326
ckeditorInit @ ckeditor_init.js:3
(anonymous) @ index.php?route=catalog/category/edit&token=jDDVk8DMvT4CECXzMhxHVmPglGBKqX2o&category_id=57:763

Мне ckeditor нравится

Share this post


Link to post
Share on other sites

Попробуйте обернуть всё в document ready:

<script type="text/javascript"><!--
  <?php if ($ckeditor) { ?>
    $(document).ready(function() {
    <?php foreach ($languages as $language) { ?>
	    ckeditorInit('input-description<?php echo $language['language_id']; ?>', getURLVar('token'));
		ckeditorInit('input-seria_descrip<?php echo $language['language_id']; ?>', getURLVar('token'));
    <?php } ?>
  });
  <?php } ?>
  //--></script>

 

Share this post


Link to post
Share on other sites
Только что, efremovav сказал:

Попробуйте обернуть всё в document ready:

<script type="text/javascript"><!--
  <?php if ($ckeditor) { ?>
    $(document).ready(function() {
    <?php foreach ($languages as $language) { ?>
	    ckeditorInit('input-description<?php echo $language['language_id']; ?>', getURLVar('token'));
		ckeditorInit('input-seria_descrip<?php echo $language['language_id']; ?>', getURLVar('token'));
    <?php } ?>
  });
  <?php } ?>
  //--></script>

 

не хочет работать. Summernote в настройках включил - он нормально работает.

Edited by nash

Share this post


Link to post
Share on other sites

только что проверил на чистом ocStore 2302 - из первого поста все работает без плясок с бубном

Share this post


Link to post
Share on other sites
15 часов назад, AlexDW сказал:

только что проверил на чистом ocStore 2302 - из первого поста все работает без плясок с бубном

мда... чет глюк какой-то

Share this post


Link to post
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.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.