Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-02-15 11:21:06
- AlexK
- Member
- Registered: 2006-02-14
- Posts: 19
How do I get a custom field in my (head) title?
Well, the topic kind of says it all, How do I get a custom field in my (head) title?
My title for the article pages are like this: “Review of <txp:custom_field name=“alt”/> – InspirationKing”
Where Alt is the name I want in the title.
Everything seems fine, right? No. My title just says “Review of – InspirationKing”.
Thank you!
Offline
#2 2006-02-15 12:25:14
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: How do I get a custom field in my (head) title?
you’ll need to put an article tag in your <title></title>
because custom fields are part of articles
something like
<title><txp:if_individual_article><txp:article form="return-title" /><txp:else /><txp:page_title /></txp:if_individual_article></title>
does that help?
Last edited by nardo (2006-02-15 12:25:44)
Offline
#3 2006-02-15 12:36:57
- AlexK
- Member
- Registered: 2006-02-14
- Posts: 19
Re: How do I get a custom field in my (head) title?
I tried that, and as you can see: http://www.inspirationking.com/featured_review/ux-mag it doesn’t really work.
Thanks!
PS. I experimented with it, and the closest I could get was getting the 3 latest gallery entries in the title.
Grrrr.
Offline
#4 2006-02-15 16:35:49
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How do I get a custom field in my (head) title?
Sounds like you didn’t use the if_individual_article tag. Can you post the exact tag(s) you’re trying to use?
Offline
#5 2006-02-15 18:35:55
- AlexK
- Member
- Registered: 2006-02-14
- Posts: 19
Re: How do I get a custom field in my (head) title?
<title><txp:if_individual_article><txp:article form="title" /></txp:if_individual_article></title>
And the form “title”:
<txp:custom_field name="alt"/>
Thank you so much :)
Last edited by AlexK (2006-02-16 09:12:20)
Offline
#6 2006-02-15 23:16:12
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: How do I get a custom field in my (head) title?
Offline
#7 2006-02-16 09:12:35
- AlexK
- Member
- Registered: 2006-02-14
- Posts: 19
Re: How do I get a custom field in my (head) title?
Oh, I realized now. Thanks!
Offline