Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-20 15:15:46

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

customfieldname="value" attribute of article_custom

in my experience, the tag fails if the custom-field has a hyphen in its name

my page template
<code><txp:glx_if_not_section_frontpage><txp:article form=“article_video” /></txp:glx_if_not_section_frontpage></code>

in my article_video form
this outputs 10 articles in the releases section, regardless of what’s in the cat-no custom-field
<code><txp:article_custom section=“releases” form=“list_releasesBrief” cat-no=“001” /></code>

but if I change the name of the custom field to “cat_no” and change the attribute accordingly
<code><txp:article_custom section=“releases” form=“list_releasesBrief” cat_no=“001” /></code>
I get just what I want – articles in the releases section specifically where the cat_no custom field has a value of “001”

I guess I’m nesting articles – could be relevant(?)

Offline

#2 2006-07-20 20:02:44

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

Re: customfieldname="value" attribute of article_custom

No, it’s not something you’ve done, but because of how custom fields work: they are variables, and in PHP variables cannot contain hyphens, etc: a valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.

It’d likely be a good idea for there to be both names and human-friendly title’s for custom fields, like there are for categories, etc.

Offline

#3 2006-07-20 23:47:39

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

Re: customfieldname="value" attribute of article_custom

Actually it’s more to do with the txp tag parser and its limitations on attribute characters. But, yes: not all characters will work in a custom field name.


Alex

Offline

#4 2006-07-21 07:15:54

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: customfieldname="value" attribute of article_custom

thanks folks
it’s good to know I wasn’t just losing the plot anyway :)
is this limitation documented anywhere? seems like the kinda thing that would be useful in a faq or something.

Offline

#5 2006-07-21 07:48:10

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

Re: customfieldname="value" attribute of article_custom

is this limitation documented anywhere? seems like the kinda thing that would be useful in a faq or something.

In the documentation that’s carefully hidden at the top of every forum page, including this one.


Alex

Offline

#6 2006-07-21 07:57:35

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: customfieldname="value" attribute of article_custom

arf!
shall I book an eyes or brain transplant first?
(don’t answer that)

Offline

Board footer

Powered by FluxBB