Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-01-13 17:45:27
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Random article, custom field, limiting to one entry
Yep. This kind thing this time: I’m building a portfolio-site where every article is one case the owner has served. One custom field contains the customer of that case. I’d like to show list of these customers in random order on the frontpage. So far so good, using article_custom and specifi form no prob., but: is it possible to limit one custom field value to show only once in the list? So when she have done many works for same customer, that wouldn’t appear many times in the list?
Edit. And not to take count articles which have not that custom field set to prevent empty entries?
Last edited by ultramega (2008-01-13 17:50:00)
Offline
#2 2008-01-13 23:25:34
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Random article, custom field, limiting to one entry
Something like this (in your form)?
<txp:if_custom_field name="customer">
<txp:if_different>
<txp:custom_field name="customer" />
</txp:if_different>
</txp:if_custom_field>
Edit: though you will have to sort by the custom field in order to make the if_different tag work… but as far as I know it’s the only way to show every customer only once.
Last edited by els (2008-01-13 23:27:58)
Offline
#3 2008-01-14 08:01:27
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Re: Random article, custom field, limiting to one entry
Ok, I’ll try that. Thanks Els.
Offline