Bike Posted November 29, 2021 Share Posted November 29, 2021 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"> </a> 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 More sharing options...
Zeka Posted November 29, 2021 Share Posted November 29, 2021 Hi @Bike There is Textformatter type of modules that are applicable in such cases. You can take a look at this module https://github.com/Toutouwai/TextformatterProcessImages from @Robin S Probably it can suit your needs or at least you can use it as a staring point. 4 Link to comment Share on other sites More sharing options...
Bike Posted November 30, 2021 Author Share Posted November 30, 2021 Thanks a lot @Zeka! This does the trick for me ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now