Ckeditor module has hooks to add plugins; node embed should be using those.

With this patch no moving of files is needed to integrate with the ckeditor module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hefox’s picture

Status: Active » Needs review
FileSize
6.47 KB

lightbox is a problem

SpadXIII’s picture

Re-rolled the patch against latest dev.
Downloaded the latest iframedialog (4.2.3) and included that in the patch. Also fixed the height-issue of the iframe.

SpadXIII’s picture

Title: Make it so don't need to move files into ckeditor to use » ckeditor module integration
ADrupalUser’s picture

I got an error running patch from #2 against latest dev:
Hunk #1 FAILED at 21.

Maybe since I'm running CKEditor 4.3, not 4.2.

gmclelland’s picture

http://ckeditor.com/addon/iframedialog lists the different versions of iframedialog to use. I don't think this module should include the plugin because Ckeditor requires specific versions for it to work.

I think it should simply include documentation on how to set this up. example...
For Ckeditor support choose the correct version of iframedialog at http://ckeditor.com/addon/iframedialog and place the iframedialog plugin into your sites libraries folder like sites/all/libraries/ckeditor/plugins/iframedialog
You can find the acceptable locations for plugins at ttp://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7/Plugins

The plugin should automatically be detected as indicated in http://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7/Plugins

Then I think this module should only include the plugin definition

/**
 * Implements of hook_ckeditor_plugin().
 */
function node_embed_ckeditor_plugin() {
  return array(
    'NodeEmbed' => array(
      'name' => 'NodeEmbed',
      'desc' => t('Node Embed - embed nodes in content.'),
      'path' => drupal_get_path('module', 'node_embed') .'/ckeditor/NodeEmbed/',
    ),
  );
}

I tested and it does work fine this way.

hefox’s picture

The current download instructions are not computable with easily adding this module to make file, because they want it added into an existing module, and I know of no way to specify that in a make file. Entire reason for making this issue.

MrHaroldA’s picture

Assigned: Unassigned » MrHaroldA
Status: Needs review » Needs work

gmclelland is right: node embed should not include this javascript library, but depend on it using libaries. I'll look into it and hope to fix this asap.

MrHaroldA’s picture

Priority: Normal » Major

  • MrHaroldA committed 5a6ca97 on 7.x-1.x
    Issue #2155433: add hook_ckeditor_plugin() and hook_requirements().
    
MrHaroldA’s picture

depend on it using libaries

... which doesn't work for plugins within libraries, so I added a hook_requirements() myselft to check for DRUPAL_ROOT . ckeditor_library_path() . '/ckeditor/plugins/iframedialog/plugin.js'.

I've committed both hook_requirements() and hook_ckeditor_plugin() like in the attached patch.

http://cgit.drupalcode.org/node_embed/commit/?id=5a6ca97aa0eadc42dc3d049...

MrHaroldA’s picture

Status: Needs work » Fixed
MrHaroldA’s picture

Status: Fixed » Closed (fixed)

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

Rob C’s picture

Just adding the patch for the 1.1 release, no need to test.

emanaton’s picture

Add re-roll of /node_embed-ckeditor_integration-2155433-2_0.patch for the 1.1 branch for the sake of backwards compatibility with legacy projects.

bibo’s picture

@hefox :

The current download instructions are not computable with easily adding this module to make file, because they want it added into an existing module, and I know of no way to specify that in a make file. Entire reason for making this issue.

I had also trouble making it work with our site.make-file. I ended up with this version which works:

projects[NodeEmbed][type] = "module"
projects[NodeEmbed][subdir] = "contrib/ckeditor/plugins"
projects[NodeEmbed][download][type] = "copy"
projects[NodeEmbed][download][url] = "file://conf/NodeEmbed"

projects[iframedialog][type] = "module"
projects[iframedialog][subdir] = "contrib/ckeditor/plugins"
projects[iframedialog][download][type] = "get"
projects[iframedialog][download][url] = "http://download.ckeditor.com/iframedialog/releases/iframedialog_4.5.6.zip"

This assumes ckeditor is installed under sites/all/modules/contrib/ckeditor, and that I've copied the "NodeEmbed"-folder from node_embed-module to a temporary location relative to site.make/build-script in repo: "conf/NodeEmbed/".