Hi everybody,
I'm working on several multi sites with the same CKEditor profile, and shared featured but different paths for editor styles and editor.css. Depending on conditions (e.g. domain or theme) I needed additional tokens.
Therefore I have created a patch with several hooks to support this new feature and implemented the hook to provide current functionality.
Instead of the current:
%h - host
%t - theme
%m - module
You can extend or alter these tokens with e.g.:
%site - site config path
%activetheme - current active theme
%domaintheme - current domains theme
Please review my work and let me know this functionality is interesting for the ckeditor module or code improvements are needed.
Thanks!
Cheers,
Eric
Comment | File | Size | Author |
---|---|---|---|
#12 | ckeditor-style-css-tokens-2713419-9-7.x-1.x-dev.patch | 8.24 KB | ericclaeren |
#2 | ckeditor-style-css-tokens-2713419-7.x-1.x-dev.patch | 7.63 KB | ericclaeren |
Comments
Comment #2
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedComment #3
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedComment #4
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedComment #7
rudiedirkx CreditAttribution: rudiedirkx commented</br>
$context
, maybe in a sub list in the comment, with descriptions.This is a great addition!
%h
is always too broad, and%t
is usually too specific. Maybe ckeditor could add%s
(e.g./sites/mysite/
) as a token by default too? It's in between%h
and%t
specificity-wise.Comment #8
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedComment #9
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedComment #10
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedComment #12
ericclaeren CreditAttribution: ericclaeren at ezCompany commentedDamn uploaded the wrong patch, this is the correct one.
Comment #14
rudiedirkx CreditAttribution: rudiedirkx commentedMaybe tests?
Comment #15
rudiedirkx CreditAttribution: rudiedirkx commentedhttps://www.drupal.org/pift-ci-job/622798 passed, and I've tried it, and I like it.
%s
is SO valuable!Comment #16
jcisio CreditAttribution: jcisio at Axess Open Web Services commentedThanks, it's a reasonable add-on. I've only done a quick review:
- Coding standards: unneeded empty trailing lines in docblocks, each sentence should end with ".", comments are wrapped at 80 characters but not before.
- Some copy/paste leftover: $context of hook_ckeditor_path_tokens_alter().
- The array keys are without "%" in the hook, but with "%" in the alter hook, which leads to confusion. I'd suggest add "%" prefix everywhere and do not force it (so a token could be without "%" prefix, it may use another prefix or no prefix at all).
Comment #17
steniya CreditAttribution: steniya commented