Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-05-05 09:00:58
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
filtering articles with custom fields
I am trying to filter articles using custom fields
This is the example on the textpattern website
<txp:article_custom colour="red" />
and this is the sintax I am using, for a custom field named “Tipo de Ocio” and a value “Teatro”, in a section called “Ocio” like this:
<txp:article_custom limit="20" form="fichas" section="Ocio" Tipo de Ocio="Teatro"/>
but is not outputting anything at all.
Offline
Re: filtering articles with custom fields
mlarino wrote:
<txp:article_custom limit="20" form="fichas" section="Ocio" Tipo de Ocio="Teatro"/>
I think it’s the spaces in your custom field name causing the problem.
Last edited by Bloke (2009-05-05 09:06: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 2009-05-05 09:11:00
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: filtering articles with custom fields
Hi Bloke!
tested that,
made a new tag with a different custom field
<txp:article_custom limit="20" form="fichas" section="Ocio" Zona-Madrid="Salamanca"/>
Still not showing any articles this way… :(
Could the custom_fields plugin be doing something that makes this tag obsolete?
Offline
Re: filtering articles with custom fields
Sometimes reading docs might help and specially the tag reference
Custom names may include letters (uppercase or lowercase), numbers and under_scores, but no spaces or other special characters.
As variables can not consist those kind of things. Right now you are using something that is called the minus mark.
Last edited by Gocom (2009-05-05 09:13:22)
Offline
#5 2009-05-05 09:19:02
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: filtering articles with custom fields
Oh Oh…
If I edit the name of the custom field all the articles I have using that custom field wont change right? I can edit it with no problem.
I will try to do that and see how it goes.
Thanks!
Offline
#6 2009-05-05 09:26:31
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: filtering articles with custom fields
It Works!
Thank you both! I would read tag reference next time :)
Offline
Pages: 1