I installed the library ckeditor, but some of the existing features do not appear in the list of buttons. For example, I did not see the button smileys. But the most important thing that I really need is a button to add a frame youtube. It also is not in the list. I added a line config "config.extraPlugins = 'tliyoutube';", as written on the site, but it did not help :(
Tell me, what did I do wrong?

Comments

sayansk’s picture

Issue summary: View changes
sayansk’s picture

Issue summary: View changes
sayansk’s picture

Today I opened the online form on the mobile phone using Opera. After the switch move saw two text format toolbar editor. While one of them, one taller, contained all the right buttons, but the one next to the text that form are the same as in a regular browser ... how to understand? Where did this second form, and how to pull it out of the necessary buttons?

sayansk’s picture

Keep digging plugin. To diagnose the problem decided to try other versions of the library CKEditor. But no matter what version I have not tried zakachavali in site/all/libraries/ page admin/config/content/wysiwyg/profile/full_html/edit no changes occur. Although, if you rename the entire folder site/all/libraries/ ckeditor plugin list disappears ... Cache cleaning, update.php ran ...

TwoD’s picture

Wysiwyg currently only knows about the plugins provided with the Full CKEditor package, so you need at least that. I don't think a Youtube specific plugin is in that package, but you can download it separately and put it with the other plugins. Then you need to create a small Drupal module to tell Wysiwyg about this plugin and if it has any toolbar buttons. You do this by implementing hook_Wysiwyg_plugin(), see wysiwyg.api.php for details on the hook, and search the issue queue for examples. This needs to be done because Wysiwyg by default ignores the configuration file and passes settings in directly to the editor, or it would not be possible to enable/disable butttons from within Drupal.

TwoD’s picture

It's a bit difficult to understand what you saw happening in mobile Opera, but all I can say right now is that we don't officially support mobile browsers. They have historically had very bad WYSIWYG support and most editors have not worked at all with them, so we perform no testing on mobile devices at this time.

sayansk’s picture

Sorry ... create a separate module for I will not under force :( ... a shame, because I was already almost done :(

TwoD’s picture

I don't understand exactly what you're saying, but here's exactly what you need to do:

  1. Download CKEditor Full package (or at least start with it).
  2. Extract the CKEditor package to sites/all/libraries
  3. Download the Youtube plugin from http://ckeditor.com/addon/youtube
  4. Create new subfolder sites/all/libraries/ckeditor_plugins.
  5. Extract the Youtube plugin to sites/all/libraries/ckeditor_plugins/
  6. Create new subfolder sites/default/modules/ckeditor_youtube/ for your new module
  7. Create sites/default/modules/ckeditor_youtube/ckeditor_youtube.info containing:
    name = CKEditor Youtube
    description = Integrates the Youtube plugin for CKEditor
    core = 7.x
    dependencies[] = wysiwyg
    
  8. Create sites/default/modules/ckeditor_youtube/ckeditor_youtube.module containing:
    /**
     * Implements hook_wysiwyg_plugin().
     */
    function ckeditor_youtube_wysiwyg_plugin($editor, $version) {
      $plugins = array();
      if ($editor == 'ckeditor' && version_compare($version, '4.0', '>=')) {
        $plugins['youtube'] = array(
          'url' => 'http://ckeditor.com/addon/youtube',
          'path' => wysiwyg_get_path('ckeditor_plugins') . '/youtube',
          'buttons' => array(
            'Youtube' => t('Youtube'),
           ),
           'options' => array(
             'youtube_width' => '640',
             'youtube_height' => '480',
             'youtube_related' => TRUE,
             'youtube_older' => FALSE,
             'youtube_privacy' => FALSE,
           ),
           'load' => TRUE,
           'internal' => FALSE,
        );
      }
      return $plugins;
    }
    
  9. Enable your new CKEditor Youtube Drupal module.
  10. Enable the new Youtube button on your CKEditor profile(s).

No need to change any other files, so ignore the instruction to modify config.js in the ckeditor folder. It's not normally used since Wysiwyg takes care of that for you.

NOTE: I've not actually tested the above code. It should work based on the instructions from the Youtube plugin page, but I may have made a few typos. If it does not work, I'll happily fix it.

If you don't want to create a new sites/all/libraries/ckeditor_plugins folder and want to keep the plugin with CKEditor itself, just change 'internal' => FALSE to 'internal' => TRUE and remove the 'path' => .... line in the .module file, and of course extract the Youtube plugin to sites/all/libraries/ckeditor/plugins instead. That should also work if you build a custom CKEditor package which includes the Youtube plugin.

TwoD’s picture

Assigned: sayansk » TwoD
Priority: Critical » Normal
Issue tags: -youtube

Reassigning this to me since I'll be providing support.

TwoD’s picture

Status: Active » Fixed

I'll close this as fixed for now, please change it back to Active if you have more questions.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

deardagny’s picture

In case anybody comes across this, TwoD's module works great, it's just missing a closing parenthesis on this line (right before the opening curly bracket):

<?php

if ($editor == 'ckeditor' && version_compare($version, '4.0', '>=')) {

?>

Also, don't forget to add the <iframe> tag to the allowed tags list in your text format settings, otherwise the embedded video will get stripped out.

TwoD’s picture

Typo fixed, thanks @deardagny!

haunted’s picture

Thank you very much, it is just what I needed!
Is there the intention to include this in some future relase of the WYSIWYG module or it will become a separate module?
I hope one of two things because it is very useful.