Keyword

Images using the 'Image' tab are not responsive

  • Paulette Nelsen
  • Paulette Nelsen's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 8 months ago #116509 by Paulette Nelsen
Images using the 'Image' tab are not responsive was created by Paulette Nelsen
:( I'm having a terrible time getting images to be responsive when using the 'Image' tab in K2. I'm setting up a small news site and just transferred all the articles from Joomla to K2. I'm running Joomla 3.1, K2 2.6.7 and using Rockettheme Voxel Responsive template.

If I enter the image into the article only and use the rt-image class for the image, they resize fine - but I can accomplish this with Joomla articles. Part of the beauty of K2 is the ease of use for my editorial department, the tabs at the top, Image, Image Gallery, Media. They are very excited with K2..... me on the other hand, I have to get the images to be responsive.... and I'm failing:( :pinch:
Please can someone help me get this figured out?

The site is csi.nethopper.net - in development

Please Log in or Create an account to join the conversation.

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 8 months ago #116510 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Images using the 'Image' tab are not responsive
Your link returns 404 error.

Perhaps you can try removing the inline css width for images set in item.php

Remove
style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;"

and add the class for rt-image

K2 Rocks \m/

Please Log in or Create an account to join the conversation.

  • Paulette Nelsen
  • Paulette Nelsen's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 8 months ago #116511 by Paulette Nelsen
Replied by Paulette Nelsen on topic Re: Images using the 'Image' tab are not responsive
Thank you for responding! Apologies, the site was down for a short time, but is back up now. I will try what you suggested, thank you!

Please Log in or Create an account to join the conversation.

  • Franz Wohlkönig
  • Franz Wohlkönig's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #116512 by Franz Wohlkönig
Replied by Franz Wohlkönig on topic Re: Images using the 'Image' tab are not responsive
Got an 403-Error

Please Log in or Create an account to join the conversation.

  • Paulette Nelsen
  • Paulette Nelsen's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 8 months ago #116513 by Paulette Nelsen
Replied by Paulette Nelsen on topic Re: Images using the 'Image' tab are not responsive
What a bad week.... Sorry, please can you try now? The items in question would be off the News> Latest Headlines link. That's what K2 is in control of. Or you can click one of the latest news links on the home page (they don't seem to be gabbing the attest articles tho..... A problem for another day :dry:

Thank you for looking

Please Log in or Create an account to join the conversation.

  • Paulette Nelsen
  • Paulette Nelsen's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 8 months ago #116514 by Paulette Nelsen
Replied by Paulette Nelsen on topic Re: Images using the 'Image' tab are not responsive
Thanks for the information - I tried that but it didn't change anything. I put it back the way it was because I don't want to forget what steps I've done. I have backups, but I need to keep track of my steps... been working long hours and memory is getting a little foggy.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 months ago #116515 by Lefteris
It's been a couple weeks since anyone's said anything here and I don't know if you've found a solution but for anyone interested...

I had some luck with making the image responsive by editing the item.php file to use a percentage rather than a definitive px setting. First, on my server, I made a new folder in the components/com_K2/templates directory and copied the item.php file into it from the default folder. Next, In your itemImageBlock div in the item.php file, change this:
style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;
to this:
style="width:<?php echo $this->item->imageWidth; ?>%; height:auto;
and save it to your new template folder to replace the default item.php copy.

In the admin backend for that category, I assigned this new template. Then for the global K2 Parameter settings for images, for whatever size you're using for your primary item image, change that pixel dimensions to a percentage that works for your page layout and just ignore that the language file is echoing the text for a dimension in px. You could change the language file to say "%" instead of "px" in your admin UI but it would just get overridden with any K2 update. The beauty of using your own template is that a K2 update won't overwrite your own template's changing the px to % in your item.php file.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #116516 by Reynaldo
Hi Rob!

I had success making the image from the K2 image tab responsive changing the code as you recommended in the item.php. but this change only affected the item view.
Where can I change the code so I can also see the pictures resonsives in my category listing?
Mi home menu is a Menu Item Type K2 Categories and I need to be responsive

thks!

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #116517 by Lefteris
@Reynaldo

Try this:
.catItemImageBlock img { max-width: 100%;}

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago #116518 by Timothy Johnston
Replied by Timothy Johnston on topic Re: Images using the 'Image' tab are not responsive
Hey Rob.

I tried this, and it works perfectly from a resizing perspective, but the resolution of the images was lost, and they became blurry.

Did you also experience this? What do you reckon I could change to avoid it?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum