Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-18 10:30:53

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Use custom fields in txp:aticle or txp:custom_article

I’m having some problems using custom fields.

To create a list of articles where the custom field “custom1” have the value “true” I’ve used the following:

<txp:article_custom custom1=“true” />

This works, listing those articles that match the value above. However, I’m getting the following error:

An error occurred in the following tag: <txp:article_custom custom1=“true” /> -> Textpattern Notice: unknown_attribute: custom1 on line 582

What am I doing wrong? I’ve tried re-naming the custom field, but this makes no difference.

Offline

#2 2006-10-18 10:51:22

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Use custom fields in txp:aticle or txp:custom_article

Isn’t it custom_1 instead of custom1?

Last edited by ruud (2006-10-18 10:53:22)

Offline

#3 2006-10-18 10:58:34

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: Use custom fields in txp:aticle or txp:custom_article

custom_1 works too, but I still get the same error.

I’m guessing I can refer to the first custom field in two ways, “custom_1” or the text label that’s defined under admin preferences.

Offline

#4 2006-10-18 11:03:46

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,391
Website GitHub Mastodon

Re: Use custom fields in txp:aticle or txp:custom_article

ruud wrote:

Isn’t it custom_1 instead of custom1?

It is whatever you name it in the preferences (txp:article eats all custom attributes by preferences name, not by database column name), and I further think this is a condition which is not accounted for here while using lAtts.

Fix due in 4.0.5?

Offline

#5 2006-10-18 11:07:09

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Use custom fields in txp:aticle or txp:custom_article

wet is right, the warning comes from the lAtts function.
So for now you can ignore the warning if you know that the attribute is correct and if it’s working as you intend. When you switch the site status to ‘live’, the warning will disappear.

Offline

#6 2006-10-18 11:16:09

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,391
Website GitHub Mastodon

Re: Use custom fields in txp:aticle or txp:custom_article

I will post an enhancement request. Maybe somebody’s already awake after yesterdays release party ;-)

Offline

#7 2006-10-19 18:15:30

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Use custom fields in txp:aticle or txp:custom_article

I’ll fix that right now.

Offline

Board footer

Powered by FluxBB