Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-10-27 03:26:13
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Highlighting Results (Table Rows) In An Article List
I have searched the forum, could not locate an answer, so I am hoping someone can assist. On my current project, I have a search box on the right that allows the user to select from a category list. Once they make the selection, those articles which contain that category display, in a table like format. Pretty straight forward.
What I want to be able to do is highlight certain rows (articles) in the table. I am uncertain how to actually pull this off. My thought is to either use the keyword field or a custom field to act as the trigger for which rows (articles) would be highlighted, but not sure how to take it from there.
Any and all input would be appreciated.
By the way, Thank you to Mary (who has asisted me in the past) and all the TXP Developers for the most recent release. Your hardwork is greatly appreciated by everyone of the devoted TXP users.
Progre55
Last edited by progre55 (2006-10-27 03:27:18)
Offline
#2 2006-10-27 20:10:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Highlighting Results (Table Rows) In An Article List
I’m not entirely sure I understand what you’re after, but I’ll give it a go.
I assume your article form looks something like:
<tr>
<td><txp:permlink><txp:title /></txp:permlink></td>
<td>maybe another table cell</td>
</tr>
What you can do is use a custom field named for example ‘highlight’. For the articles you want highlighted, give it a value, for example red
.
Your form:
<tr<txp:if_custom_field name="highlight"> class="<txp:custom_field name="highlight" />"</txp:if_custom_field>>
<td><txp:permlink><txp:title /></txp:permlink></td>
<td>another table cell</td>
</tr>
Style tr.red
in the CSS.
Offline
#3 2006-10-28 02:43:50
- NyteOwl
- Member
- From: Nova Scotia, Canada
- Registered: 2005-09-24
- Posts: 539
Re: Highlighting Results (Table Rows) In An Article List
If you are using a list (<ul>,<ol>) rather than a table (<table>) you might try the Zem_nth plugin.
Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;
Offline
#4 2006-10-28 12:33:27
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Highlighting Results (Table Rows) In An Article List
Of course zem_nth is better if you want to highlight every n th row. If that’s what you meant, forget my answer ;)
Offline
#5 2006-10-28 23:38:55
- NyteOwl
- Member
- From: Nova Scotia, Canada
- Registered: 2005-09-24
- Posts: 539
Re: Highlighting Results (Table Rows) In An Article List
Els :) I reread the original post and kind of assumed a regular repeating pattern. If not, see Els’ method :)
Between the two options it should cover most situations :)
Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;
Offline
#6 2006-10-29 03:12:20
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: Highlighting Results (Table Rows) In An Article List
Thanks to both of you. I was actually looking for Els solution, but appreciate the NyteOwl’s input and I will definitely possibly think of using NyteOwl’s for another situation.
Thanks again.
progre55
Last edited by progre55 (2006-10-29 03:13:09)
Offline
#7 2006-11-02 17:02:55
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: Highlighting Results (Table Rows) In An Article List
Els:
Just wanted to let you know, your solution worked great.
Thanks.
progre55
Offline
#8 2006-11-02 17:19:15
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Highlighting Results (Table Rows) In An Article List
Good to hear :)
Offline