Posted by joachim on January 8, 2009 at 1:51pm
| Project: | Similar Nodes |
| Version: | 5.x-1.1 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
The SimilarNodes: Weight field is required to make a view work, but it's ugly -- users have no reason to see a bunch of numbers that are meaningless to them.
It would be good if the module could work without it, but looking at the comments in the code, it seems probably not!
What does work is adding two handlers to the field definition: visible and hidden.
Expand the field definition to this:
'fields' => array('similar_weight' => array('name' => t('SimlarNodes: Weight'),
'query_handler' => 'similarnodes_sum',
'help' => t('The similarity weight to the provided nid'),
'handler' => array(
'similarnodes_weight_visible' => 'Visible',
'similarnodes_weight_hidden' => 'Hidden',
),
'sortable' => TRUE)),and add some handler functions:
function similarnodes_weight_hidden($fieldinfo, $fielddata, $value, $data) {
// return NOTHING!
return;
}
function similarnodes_weight_visible($fieldinfo, $fielddata, $value, $data) {
return check_plain($value);
}