Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[SOLVED] list articles by custom field
I am trying to parse a series of articles with the events staged in the NeMe Arts Centre. I have a custom field named venue and I am using the code below which for some reason it does not work.
A detail which may be important here is that the value in the CF is sometimes followed by a comma. ie NeMe Arts Centre,
<txp:article_custom limit="999" label="Previously at NAC" venue="NeMe Arts" section="events, participations" labeltag="h3" break="li" wraptag="ul" class="submenu">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
Can anybody see what I might be doing wrong?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] list articles by custom field
I’m not sure that content fields do ‘contains’ statements.
And do you get matches if you use the exact wording, e.g. venue="NeMe Arts Centre"?
If you don’t have too many instances with the comma, you could clean those entries and add the comma via CSS using …:after { content: ", "; }.
Wasn’t there also a way of using % as a wild card for “zero or more”? Something like venue="NeMe Arts Centre%"…
TXP Builders – finely-crafted code, design and txp
Offline
Re: [SOLVED] list articles by custom field
Thanks so much Julian,
The percentage symbol did it. Below is the final code and here it is the sidebar sub-menu in action.
<txp:article_custom limit="999" label="Previously at NAC" venue="NeMe Arts Centre%" section="events, participations" labeltag="h3" break="li" wraptag="ul" class="submenu">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline