excessively minor "fix" to get this button to show up. In editors/ckeditor.inc line 315 add 'Templates' => t('Templates'), and you'll get templates as an available option in CKEditor. If it's not going to be added into the project then at least this is here to tell people how to add it since I saw a bunch of people posting asking how to integrate it.

Comments

twod’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
Status: Active » Postponed

The Wysiwyg template plugin is a project dedicated to work with the template plugin for TinyMCE, but the maintainer seems interested in integrating with other editors as well. Probably a good place to start building a GUI and cross-editor template handling before Wysiwyg itself has these capabilities. Wysiwyg itself still needs a lot of work on its core features before this plugin becomes useful without having to modify library files, so I'm going to postpone this until we have a better framework to handle it.

Note that when #313497: Allow configuration of advanced editor settings gets in, it should be possible to set settings like templates_files and templates_replaceContent (CKEditor) so at that point it would make more sense to include this button. (The user would be able to point the editor to a template file other than the default one, so it wouldn't be overwritten when updating the editor library.)

mandclu’s picture

Status: Postponed » Needs review
StatusFileSize
new682 bytes

Sorry if this seems like I'm hijacking an old thread. In the comments on my case study it was suggested I submit back the changes I made in order to make Templates a useful function on the site detailed there.

In fact, this patch adds the line suggested by btopro in the original issue, as well as an extra line that turns off the default to replace all content, which was critical for us and I think makes more sense in a Drupal context. I suppose in theory you could make that a separate setting.

I agree with TwoD that this would be better addressed as part of a larger thrust to address advanced settings, which will allow for customizing the templates themselves without hacking files. That thread seems to have been moved up to 7.x, however, and I think there's something to be said for making this feature available to 6.x users.

As for Wysiwyg Template, installing an entire module to accomplish something that can be achieved in a line two seems excessive, IMO.

eigentor’s picture

StatusFileSize
new33.98 KB
new817 bytes

Thx surge_martin. This patch is simple indeed, helped me activate the Templates feature for CKeditor. Sure - one has to edit the CKeditor templates file and all and this will be much cleaner in the future, but for the time being, it just works for the people that know how to use it.
This is how the button looks

And this is the popup with the predefined CKeditor Templates. Inserting them works fine, and, thanks to the patch, does not replace the entire content but rather add to it.

esbon’s picture

Please add the Source and Templates to the list of buttons and plugins.

Please disregard this comment!

marcoka’s picture

Component: Editor - CKeditor » Code

Was not thinking right. Its working, but remember to activate it on the wysiwyg profila page after applying the patch

andyf’s picture

Applied the patch and works for me, thanks!

firebird’s picture

Note to anyone looking for the Drupal 7 way of using templates; There's a module for that: http://drupal.org/project/wysiwyg_template

btopro’s picture

Status: Needs review » Fixed

it's great for D6 too and I use it now without any need to patch either. I'm not sure what to mark this other then closed because there's something that satisfies the original need of this issue

Status: Fixed » Closed (fixed)

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