As the title suggests that is what I am attempting to do.
I have found this (see below):
Go to admin/settings/lightbox2/automatic
Click "custom class images"
With "Source" enabled in CKEditor, add for example the classname "lightbox" in the textbox (or whatever name you prefer).
Click "Save configuration"
When adding an image to a page make sure to add an URL to the image both under the "Image info" tab BUT ALSO under the "Link" tab!
Go to the "Advanced" tab and write "lightbox" (or whatever you called the classname above) in the "Stylesheet classes" box.
Done. When clicking on the image it should now show up in a lightbox!
http://www.rightinfonow.com/drupal-lightbox-ckeditior
------------------------------------------------------------------------------------
The above would work if I could automate / pre-fill the two items:
1) Same URL to the image under the "Image info" tab AND ALSO under the "Link" tab!
2) In "Advanced" tab "lightbox" in the "Stylesheet classes" box.
Any help with this would be appreciated !
Comments
Comment #1
dczepierga commentedHi,
U can write simple plugin to CKEditor which will only set this needed fields...
Tutorials to write sth like this u can found here: http://docs.cksource.com/CKEditor_3.x/Tutorials
If u have more questions pls write, i will try to help u :)
Greetings
Comment #2
rnexussix commenteddczepierga, thank you for your reply and the resource link. Unfortunately I am not a programmer, so I would not know where to begin with creating my own plug-in.
Comment #3
mkesicki commentedHere is explained, how to change default value for dialog field: http://docs.cksource.com/CKEditor_3.x/Howto/Default_Field_Values
Here is tutorial to writing basic plugin for CKEditor: http://docs.cksource.com/CKEditor_3.x/Tutorials/Timestamp_Plugin
Comment #4
rnexussix commentedStill trying to figure out which files to edit and which variables to change. Can some one help ?
PS
Come to think of it. This would of been a great feature to be included in the CKEditor Module i.e. "Enable Lightbox for CKFinder".
Comment #5
mkesicki commented@rnexussix added new feature request ticket about this: #1698122: CKEditor and CKFinder Lightbox integration
Comment #6
mkesicki commentedPlease add:
to
ckeditor.config.jsfile. After saving lightbox class should be added to all images added by CKEditor + CKFinder.If you have more problems with these , please reopen this ticket.
Comment #7
rnexussix commentedThank you michal_cksource,. We are almost there .
"lightbox" auto class addition works, but the URL field in the "Link" Tab doesn't get's auto-populated with the same URL as as the one in "Image Info" tab URL filed. Once I manually populate the "Link" tab's URL field (cut and paste same URL as in "ImageInfo", the Lightbox works. If this could be done automatically, we'd have a perfect solution.
Comment #8
rnexussix commentedComment #9
mkesicki commented@mexussix,
please try this code:
If this doesn't help you , please reopen this ticket.
Comment #10
rnexussix commentedThis worked ! Thank you !
Comment #11
mkesicki commentedComment #12
rnexussix commentedmichal,
Is it possible to set default "thumbnail" image dimensions (height and width) for the image that is being inserted (within the same script as above) ?
Comment #13
mkesicki commentedYou can set default values as in (#9) for others fields. This should help you find id of tabs and fields in image dialog: http://nightly.ckeditor.com/7590/_samples/devtools.html.
You should use code similar to:
Comment #14
rnexussix commentedI have inserted the following to test setting default image width, but the image width field still shows up empty.
What am I doing wrong ?
Comment #15
mkesicki commentedPlease try this:
Comment #16
rnexussix commentedThat did not work (lightox code still works fine). Below is the code I inserted at the bottom of the ckeditor.config.js.
Any other ideas ?
Comment #17
mkesicki commentedPlease try this:
now width is set after set/change image.
Comment #18
rnexussix commentedThank you Michal. This worked !
Should I use the same syntax to set defaults for the rest of the image attribute fields (height, border, hspace vspace alignment) ?
Comment #19
mkesicki commentedYou should use something like this:
in code that is not in onChange event (or other events.)
Please use something similar to:
in event(s).
Hope this resolve rest of your problems (doubts).
Comment #20
dczepierga commentedI think @michal_cksource, write everything about it, so i closed this issue.
If u have more problem pls reopen this issue.
Greetings
Comment #20.0
dczepierga commentedGrammar and spelling