Jump to content

Image size in CKEditor / Body


Recommended Posts

Hi everyone,

I insert images into a textarea where I keep their original upload size (about 1200px in width), so that when I eventually open them up on the page they will show up as large as possible in a lightbox.

How can I achive that all images are output as a thumb in the first place? For image fields that I have control about I would use $img->size() but since everything is packed into that $page->body field I don't know how to get in there?!

In the end I want something like:

<a href="url_to_original.jpg" data-fancybox>
  <img src="url_to_thumb.jpg">

That a-tag however I build around the image during output with some str_replace since I don't know how to do this in the right way either ? It works anyway but all that image-in-a-body thing is quite a mystery to me still.

I'd be grateful for any help!

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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