Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-04 21:38:22

Hayo
New Member
From: The Netherlands
Registered: 2006-01-04
Posts: 4
Website

Txp:custom_field problems

Hi all,

I’m having problems using custom field. All i want to do is print the custom field ‘bannername’ .
<txp:custom_field name=“bannername” />

But it just returns empty, even though it isn’t …
this is confusing the hell out of me… thoughts anyone?

Textpattern version: 4.0.2 (r1076)

Offline

#2 2006-01-04 21:57:05

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Txp:custom_field problems

All i want to do is print the custom field ‘bannername’ . But it just returns empty, even though it isn’t …

Bummer, my psychic reception has been very week during the last weeks. You’ll actually have to explain in detail and show the tags, the forms, the templates that you are using, otherwise we can’t help.

Also, have you looked at the documentation:
http://textpattern.net/wiki/index.php?title=Txp:custom_field_/ ?

Offline

#3 2006-01-04 22:05:15

Hayo
New Member
From: The Netherlands
Registered: 2006-01-04
Posts: 4
Website

Re: Txp:custom_field problems

Okay, i had that coming ;)

i have named custom field number one “bannername”. it contains the name of a banner for the article. nothing special really. the custom field exists, and is filled with values.

when i show an article, i try to test the output by simply putting

<p><txp:custom_field name="bannername" /></p>

in the template. But whatever I try, it remains empty.

It’s the simplest implementation, i got from that exact page.

Is there some way i can debug it, to find out where my missing value is?

Last edited by zem (2006-01-04 22:11:10)

Offline

#4 2006-01-04 22:09:10

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Txp:custom_field problems

What does the article form your using look like? You actually have to call the custom field expicitly in the form. The default article form doesn’t call any custom fields. something like.

<code>
<txp:custom_field name=“Bannername” />
</code>

Last edited by mrdale (2006-01-04 22:13:13)

Offline

#5 2006-01-04 22:11:46

Hayo
New Member
From: The Netherlands
Registered: 2006-01-04
Posts: 4
Website

Re: Txp:custom_field problems

the default bit.

txp:article form=“default” limit=“1” /

txp:custom_field name=“bannername” /

Your question assumes there is probably something wrong with that setup, am i correct? (yes, this is my first txp project)

edit: you mean, in the form itself, and not in the page template?

Last edited by Hayo (2006-01-04 22:14:28)

Offline

#6 2006-01-04 22:13:24

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Txp:custom_field problems

The custom_field tag should go in your article form.


Alex

Offline

#7 2006-01-04 22:16:15

Hayo
New Member
From: The Netherlands
Registered: 2006-01-04
Posts: 4
Website

Re: Txp:custom_field problems

Thanks guys, i knew it had to be a stupidly easy solution! Just getting the hang of the txp syntax seems to be my real problem :)

Offline

#8 2006-01-04 22:16:44

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Txp:custom_field problems

duplicate the default article form.

Add the <code><txp:custom_field name=“FieldName” /></code> in the order that you want it to appear in relation to the other article components (body/headline/excerpt) and Bob, as they say, is your uncle.

Offline

#9 2006-01-04 22:17:48

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Txp:custom_field problems

> Hayo wrote:

> Thanks guys, i knew it had to be a stupidly easy solution! Just getting the hang of the txp syntax seems to be my real problem :)

No problem. Forms (article and otherwise) will be your best friend. They’re why I love TXP.

Last edited by mrdale (2006-01-04 22:18:37)

Offline

Board footer

Powered by FluxBB