Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-04-12 16:37:28

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

SOLVED: if_article_image ?

Fixed the problem!

Last edited by warmbeat (2006-04-12 16:59:47)

Offline

#2 2006-04-12 16:54:21

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

Re: SOLVED: if_article_image ?

If you need the header image for a single article page, you can put your code in an article form:
<code>
<txp:if_custom_field name=“page_image”>
<txp:custom_field name=“page_image” />
<txp: else />
<txp:image id=“default-picture” />
</txp:if_custom_field>
</code>
And on the page call it with
<code>
<txp:if_individual_article>
<txp:article form=“page-image” />
</txp:if_individual_article>
</code>
The same goes for your second idea. The point is that tags that call article fields can only be used in an article form, otherwise TXP wouldn’t know which article’s fields to use.
You’ll have to turn ‘automatically append comments to articles’ off though, if you don’t want to see the comments there as well.

EDIT: So you solved it yourself while I was still writing? ;)

Last edited by els (2006-04-12 16:58:34)

Offline

#3 2006-04-12 17:03:53

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

Re: SOLVED: if_article_image ?

Hi Els,

Thanks for your help!

You were spot on. That always happens – been trying to fix this problem all afternoon! I post – then find a solution to the prob!

I used this in the end:

<code>
<txp:if_individual_article>
<txp:article form=“article-image” />
<txp:else />
<txp:image id=“2” />
</txp:if_individual_article>
</code>

Last edited by warmbeat (2006-04-12 17:04:27)

Offline

#4 2006-04-12 17:08:02

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

Re: SOLVED: if_article_image ?

warmbeat wrote:

That always happens – been trying to fix this problem all afternoon! I post – then find a solution to the prob!

I know the experience ;) It often helps when you describe the problem in writing to gain more insight.

Offline

Board footer

Powered by FluxBB