- Posts: 20
COMMUNITY FORUM
Images using the 'Image' tab are not responsive
- Paulette Nelsen
-
Topic Author
- Offline
- Junior Member
Less
More
11 years 9 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
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
-
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 9 months ago #116510
by Kannan Naidu Venugopal
K2 Rocks \m/
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
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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
11 years 9 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
-
- Offline
- Platinum Member
Less
More
- Posts: 529
11 years 9 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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
11 years 9 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
Thank you for looking
Please Log in or Create an account to join the conversation.
- Paulette Nelsen
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
11 years 9 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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 8 months ago - 11 years 8 months ago #116515
by Lefteris
Replied by Lefteris on topic Re: Images using the 'Image' tab are not responsive
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:to this: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.
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;
style="width:<?php echo $this->item->imageWidth; ?>%; height:auto;
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.
Please Log in or Create an account to join the conversation.
- Reynaldo
-
- Offline
- New Member
Less
More
- Posts: 2
10 years 11 months ago #116516
by Reynaldo
Replied by Reynaldo on topic Re: Images using the 'Image' tab are not responsive
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!
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
10 years 11 months ago #116517
by Lefteris
Replied by Lefteris on topic Re: Images using the 'Image' tab are not responsive
@Reynaldo
Try this:
Try this:
.catItemImageBlock img { max-width: 100%;}
Please Log in or Create an account to join the conversation.
- Timothy Johnston
-
- Offline
- New Member
Less
More
- Posts: 6
10 years 7 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?
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.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 7 months ago #116519
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Images using the 'Image' tab are not responsive
Timothy try using a larger image size.
This setting is located in your category's settings.
This setting is located in your category's settings.
Please Log in or Create an account to join the conversation.