Closed (fixed)
Project:
Best reply
Version:
6.x-6.6
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2010 at 23:27 UTC
Updated:
4 Jan 2011 at 06:05 UTC
I would like to show (in different color) questions with best reply marked differently than those will no best reply yet. IS that possible? Is there a theme variable available to distinguish?
Comments
Comment #1
ajayg commentedPlease note I am trying to theme title of node and NOT the comment (best reply color).
Comment #2
taslett commentedNo there is not currently a way to target the node title.
You could possibly look at preprocess_node for your theme and look at adding a class to the node.tpl.php if a comment has the bestreply.
Or use jQuery to add a class if a comment has been marked.
I think the jQuery option would be easier, something along these lines.
Comment #3
glennr commentedSorry to reopen this thread, but I'd just like to add my vote for a way to theme nodes with best replies. Or, alternatively, is there a way to create a node.tpl.php variable such as $node->bestreply via template.php?
Thanks for a great module.
Comment #4
ajayg commentedThat is what I would like to know. I am trying to distinguish nodes in view before you click on the node and see the full page. So You can either show only answered nodes list or open nodes list. The jquery option will work only if you load the entire page.
Looks like there is an attribute required for the node which need to be set once best answer is chosen.
Comment #5
ajayg commentedComment #6
taslett commented@glennr currently best reply keeps track of the comments marked as the bestreply. If you wish to add a variable to the node when it has a bestreply you could use hook_nodeapi.
This will add a variable has_bestreply to the node f it has a bestreply.
Comment #7
taslett commented@ajayg the current dev version 6.x-6.x-dev has basic views support ( needs work ).
I will try and improve that so you can be more selective.
Comment #8
taslett commentedNew release will be available soon bestreply 6.x-7.1 Closing issue.
Comment #9
glennr commentedThanks for the quick response, taslett. This works perfectly. Will you be including the code in 6.x-7.1?
Comment #10
taslett commentedYes the code is included in 6.x-7.1