Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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