Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2022-05-19 11:09:21

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,065
GitHub

Re: Dimensionless img via height="0" width="0" works no more?

etc wrote #333356:

4.9 is profiled ‘imagery’,

…and also, hopefully, moving on from old-ass PHP if / when we can decide on a plan.

Offline

#14 2022-05-19 12:10:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,946
Website

Re: Dimensionless img via height="0" width="0" works no more?

etc wrote #333356:

4.9 is profiled ‘imagery’, but I’m null in this stuff, so cf is appealing…

My wishlist is CF first and second.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#15 2023-12-06 20:55:21

halftone
New Member
Registered: 2011-12-22
Posts: 5

Re: Dimensionless img via height="0" width="0" works no more?

Sorry to ask, but this appears to be the only thread on the internet that deals with this problem.
I’ve spent 3 days on trying to sort out this problem! I’m far from expert at Txp (I inherited our site) but recently upgraded our voluntary site from 4.3 to 4.8.8, because we were using ancient Php 5.7something.

Now we have a ton of (314) articles that no longer display properly. The aspect ratio gets stretched to fit the native height of the image. We were successfully using

[code]<txp:article_image height=“0” width=“0” />[/code]

I’ve tried implementing the workaround as follows (it’s not a thumbnail, like the example)…
[code]
<if::article_image>
<txp:images>
<a href=”<txp:permlink />” <txp:image width=“0” height=“0” /></a>
</txp:images>
</if::article_image>
[/code]

CSS that controls this:
[code]
.article_image_wrapper img {
margin-left: 0;
margin-right: 0;
max-width: 100%;
height: auto;
}
[/code]

You can see how the images should display at the list of Showcases
http://www.epuk.org/showcase

but if you click on a title to the full article the image aspect ratio is screwed
eg http://www.epuk.org/showcase/henna-by-michael-amplett

TL/DR it still displays at correct width but native height, even with height: auto; in CSS

Is txp:image broken as well as txp:article_image? Any help much appreciated!

Last edited by halftone (2023-12-06 20:56:17)

Offline

#16 2023-12-06 22:02:46

etc
Developer
Registered: 2010-11-11
Posts: 4,910
Website GitHub

Re: Dimensionless img via height="0" width="0" works no more?

I think your media rules do not apply here:

@media only screen and (min-width: 768px) and (max-width: 1024px)

Offline

#17 Yesterday 18:09:08

halftone
New Member
Registered: 2011-12-22
Posts: 5

Re: Dimensionless img via height="0" width="0" works no more?

You appear to be right: @media now deprecated. I hadn’t looked at the responsive stuff, because it did work with 4.3 and still works with 4.8.8 on screens and mobiles aside from this single issue.

I’m unconvinced this is /the/ issue, but I know far too little about Txp and responsive CSS. My apologies for intruding on a devs conversation.

Thanks / Tony

Offline

#18 Today 08:15:45

etc
Developer
Registered: 2010-11-11
Posts: 4,910
Website GitHub

Re: Dimensionless img via height="0" width="0" works no more?

No worries. Yes, it still works on tablets because the corresponding rules

.article_image_wrapper  img {
margin-left: 0;
margin-right: 0;
max-width: 100%; 
max-height: 100%; 
height: auto;
width:auto;
}

belong to

<!-- @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait) {
#top_ads .ad_space {
...
} -->

section. Note that it is invalid now, because <!-- ... --> are html comments, not css. Also, the opening closing {} pairs do not match.

I’m not really a css person, but many on this forum can help.

Offline

Board footer

Powered by FluxBB