Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-01-22 11:32:55

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

need conditional maybe

Hi,
I am displaying a list of recent blog entries along the right column of a site.
The list just displays the article’s title under the articles thumbnail image which has padding and border styles applied to it. Because firefox was collapsing the border around the thumbnail I had to declare a height for it in css.
After I set it up I realized that the client probably will make some posts without images. But if there is no article image the border still appears around the specified height.

I’m wondering what’s the best way to display the posts without images. I was going to use if category but there are already too many article categories and the client is getting confused.

Thanks


its a bad hen that wont scratch itself.
photogallery

Offline

#2 2010-01-22 11:43:08

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: need conditional maybe

You probably want <txp:if_article_image>.

Offline

#3 2010-01-22 12:21:48

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: need conditional maybe

hi Els,
Yes that’s what I need. I can’t get it to work in my article list form though.

 <txp:if_article_image>
<txp:permlink><span  ><txp:article_image thumbnail="1" /></span> </txp:permlink>
</txp:if_article_image>
<h2  ><txp:permlink><txp:title /></txp:permlink></h2>

thanks

Last edited by kvnmcwebn (2010-01-22 12:22:22)


its a bad hen that wont scratch itself.
photogallery

Offline

#4 2010-01-22 17:56:50

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: need conditional maybe

I see no reason why that code wouldn’t work… Does the tag trace tell you something, or can you post it here?

Offline

#5 2010-01-22 19:09:01

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: need conditional maybe

Stupid question maybe, but you are using v4.2 aren’t you?

Offline

Board footer

Powered by FluxBB