Jump to content

Modify inserted image HTML in CKEditor pwimage plugin


pleini
 Share

Recommended Posts

Hello,

Is it possible to add custom functionality to the existing pwimage CKEditor plugin?

In the CKEditor textarea field we are trying to customize the inserted HTML source when we insert an image. The generated HTML source of the inserted image comes from insertImage() function of pwimage plugin. We want to edit this source before inserting into the textarea.

Do you have any idea how can we do it?

Thank you for the help!

Link to comment
Share on other sites

Under the Input Tab of the fieldsettings of your CKEditor Field you have an option to modify 'Extra allowed Content'. As an example, put in here the string

img[!src,class,alt,width,height]

and save settings. Now you can modify the listet attributes of the image tag in the 'source' dialog of the CKEditor field.
But you need to modify it for each input. Was it this, you have been looking for?

I f you want to use a normal Textarea Input use the textformatters Adrian recommended. Additionally I recommend Diogos Image Textformatters:

http://modules.processwire.com/modules/textformatter-image-tags/
http://modules.processwire.com/modules/textformatter-image-field-markup/

a great and highly configurable textformatter is Ryans Hanna Code Textformatter
http://modules.processwire.com/modules/process-hanna-code/

and finally mine:
http://modules.processwire.com/modules/textformatter-page-images/
Very simple to insert images with tags. The output markup, wrapping the image tag, is configurable in the textformatter module settings.

 

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...