Protostar: Neither intro or article image resize when caption is set

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
sokrates_mx5
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 179
Joined: Tue Mar 24, 2009 12:30 pm

Protostar: Neither intro or article image resize when caption is set

Post by sokrates_mx5 » Thu Oct 22, 2020 5:16 pm

I realized that when Caption is set for intro or article image in Images and Links, then the image do not resize. When I delete the caption then it resize.

Template: Protostar
Joomla: 3.9.21
PHP: 7.4.9

User avatar
huyhoa
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Tue Jul 14, 2015 9:18 am
Contact:

Re: Protostar: Neither intro or article image resize when caption is set

Post by huyhoa » Fri Oct 23, 2020 9:43 am

sokrates_mx5 wrote:
Thu Oct 22, 2020 5:16 pm
I realized that when Caption is set for intro or article image in Images and Links, then the image do not resize. When I delete the caption then it resize.

Template: Protostar
Joomla: 3.9.21
PHP: 7.4.9
It may be related to your template function or plugins. Joomla by default DON'T resize any images when you upload.
In your case, i guess it's CSS related problem.
Personal blog at: https://huyhoa.net/en/home/

sokrates_mx5
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 179
Joined: Tue Mar 24, 2009 12:30 pm

Re: Protostar: Neither intro or article image resize when caption is set

Post by sokrates_mx5 » Fri Oct 23, 2020 10:07 am

huyhoa wrote:
Fri Oct 23, 2020 9:43 am
It may be related to your template function or plugins. Joomla by default DON'T resize any images when you upload.
In your case, i guess it's CSS related problem.
I didn't mean resizing on upload. What I meant was resizing when the one minimize the window of the browser, then the image with caption do not shrink in size and the modules in the right column are shown on top of the image. Without caption the image shrinks when one make the window smaller.

I've also realized that the image without caption is aligned to the left, but when a caption is added then the image is centered.

Here's a link to an article showing an article image with a caption:

https://terrazas-del-rodeo.com/en/news/ ... -at-google

I've removed the caption of the Intro Image for this article, so in the category view of the introduction one can see the difference:

https://terrazas-del-rodeo.com/en/news

When having a caption of the Intro Image, then it behaves exactly the same as the article Image with caption above.

User avatar
huyhoa
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Tue Jul 14, 2015 9:18 am
Contact:

Re: Protostar: Neither intro or article image resize when caption is set

Post by huyhoa » Fri Oct 23, 2020 10:19 am

If you are talking about responsive mode, then look at the code, it's fixed width for that div (container of image)

Code: Select all

<div class="img_caption none" style="float: none; width: 799px;"><img class="caption" title="Screen dump 04/10/20" src="/images/photos/Jose-Urbano-Consultores/Google-reviews-of-Jose-Urbano-Consultores-2020-10-04_crop.jpg" alt="" itemprop="image"></div>
Try this instead

Code: Select all

<div class="img_caption none" style="float: none; width: 100%;"><img class="caption" title="Screen dump 04/10/20" src="/images/photos/Jose-Urbano-Consultores/Google-reviews-of-Jose-Urbano-Consultores-2020-10-04_crop.jpg" alt="" itemprop="image"></div>
Changed width: 799px; to width: 100%;
Personal blog at: https://huyhoa.net/en/home/

sokrates_mx5
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 179
Joined: Tue Mar 24, 2009 12:30 pm

Re: Protostar: Neither intro or article image resize when caption is set

Post by sokrates_mx5 » Fri Oct 23, 2020 11:48 am

huyhoa wrote:
Fri Oct 23, 2020 10:19 am
Changed width: 799px; to width: 100%;
Thanks, yes it seems to be the fixed width that creates the problem.

Are there any reasons why the inline styles are used in this div-element instead of class or id?

sokrates_mx5
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 179
Joined: Tue Mar 24, 2009 12:30 pm

Re: Protostar: Neither intro or article image resize when caption is set

Post by sokrates_mx5 » Sat Oct 24, 2020 12:20 am

Have added the following code to user.css:

Code: Select all

.img_caption.none {
	width: 100% !important;
}
Which sorted the problem :)


Post Reply

Return to “Templates for Joomla! 3.x”