cck facets?

gdoteof - November 6, 2009 - 03:45
Project:Apache Solr Search Integration
Version:6.x-1.0-rc3
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I see so much reference to cck facets, but I don't seem to have any available. They don't show up in my blocks. I realized maybe they should be showing up in 'enabled filters' but there are only things for taxonomy, nothing for CCK fields.

#1

robertDouglass - November 6, 2009 - 10:43

It depends on what kind of CCK fields you have. The only automatic CCK filters are for text fields with option widgets (check boxes, radio buttons, select lists). Do you have fields of these types that aren't showing up? That would be a bug. Other CCK fields won't show up automatically. They can, however, be added using a custom module that implements the right hooks.

#2

gdoteof - November 6, 2009 - 20:04

i do have them for select lists. I tried making a custom one for an autocomplete box following the tutorial at acquia

#3

robertDouglass - November 7, 2009 - 14:23

The tutorial at Acquia is unfortunately slightly out of date. No better documentation is available at the moment.

#4

gdoteof - November 10, 2009 - 20:32

<?php
function my_module_cck_field_mappings() {
       
$mappings = array();
       
$mappings['userreference'] = array(
               
'callback' => 'my_module_userreference_callback',
               
'index_type' => 'string',
               
'widget_types' => array(
                       
'userreference_autocomplete' => TRUE,
                        ),
        );
        return
$mappings;
}

function
my_module_userreference_callback($node, $fieldname) {
       
$fields = array();
  foreach(
$node->$fieldname as $field){
               
$fields[] = array('safe' => check_plain($field['value']));
        }
        return
$fields;
}
?>

Am I close? Anything I do show you to get a better idea of why I am not gettign any cck facets?

#5

gdoteof - November 10, 2009 - 20:39

I should have been more clear in #2. I do not have any cck facets, period. I do have cck fields that use select lists

 
 

Drupal is a registered trademark of Dries Buytaert.