Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-04-20 16:46:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,611
Website

Matching custom fields with article_custom

I’m probably a bit slow today (can’t be the beer, must be the heat ?)… but how can I obtain a list of articles with some, e.g. any value in a custom field (e.g. not empty)?

It’s easy enough for a single value, e.g. to get all jobs with a completed state of 100% you might do:

<txp:article_custom section="jobs" progress="100" limit="10" />

but how might you, say, get all jobs that have some degree of progress (e.g. where progress is not empty)?

I’d like to do this with article_custom if I can, not a plugin. Can I somehow use the “match” attribute? I’m not very familiar with it.


TXP Builders – finely-crafted code, design and txp

Offline

#2 2018-04-20 17:57:59

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Matching custom fields with article_custom

<txp:if_custom_field name="progress"> <txp:article_custom section="jobs" progress="100" limit="10" /> <txp:else/> other options... </txp:if_custom_field>

Like this?


A hole turned upside down is a dome, when there’s also gravity.

Offline

Board footer

Powered by FluxBB