Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-21 13:58:17

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Does article_custom not work within articles?

I want to pass the ID of an article via a custom field to a <txp:article_custom /> so that it displays the link and excerpt of that article:

<txp:if_custom_field name=“Article_ID” >
<txp:article_custom form=“list” id=’<txp:custom_field name=“Article_ID” />’ />
</txp:if_custom_field>

This doesn’t seem to work.

Any other ways?

Thanks in advance!

Offline

#2 2010-04-21 14:21:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,942
Website GitHub

Re: Does article_custom not work within articles?

lozmatic wrote:

This doesn’t seem to work.

Does it work if you put the custom field name in all lower case in your code? I think it should work. TXP converts the custom field names to lower case (internally).

Last edited by Bloke (2010-04-21 14:21:27)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2010-04-21 16:53:49

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

Re: Does article_custom not work within articles?

Custom field names may include letters (uppercase or lowercase), numbers and under_scores, but no spaces or other special characters.

Maybe ‘article_id’ is one of the no-go custom field names?
And is that code in an article form (or inside the container tag), or in the article body?

Last edited by els (2010-04-21 16:54:42)

Offline

#4 2010-04-22 07:23:43

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: Does article_custom not work within articles?

Bloke wrote:

Does it work if you put the custom field name in all lower case in your code? I think it should work. TXP converts the custom field names to lower case (internally).

<txp:custom_field name=“Article_ID” /> alone returns the correct value, so this is not the problem.

Els wrote:

And is that code in an article form (or inside the container tag), or in the article body?

It’s in the article body, actually. I should have tested the tag in the form! Can’t do it now ‘cause I’m at work. Will do later.

Thanks.

Offline

Board footer

Powered by FluxBB