Hi -- I found this thread on Github: https://github.com/daylightstudio/FUEL-CMS/pull/290 I have names stored in first, middle, and last name columns. Is it possible to create a display_field which has all three?
But perhaps not... I added this to my module.php, but it isn't doing anything? I tried to put a die() inside of it, but the die() did not execute, so for some reason it's not even going through the function. Do I have to put it elsewhere or do something special to make the module see it?
public function display_name($values){
if(!empty($values['id'])){
$getname = $this->attorneys_model->find('one', 'id ='.$values['id']);
$values['display_name'] = $getname->name_f.' '.$getname->name_m.' '.$getname->name_l;
return $values;
}
}
In MY_fuel_modules.php, I tried to get rid of the display_field, but it didn't make the function execute. $config['modules']['attorneys'] = array(
'preview_path' => 'attorneys/{slug}',
'display_field' => 'name_l',
'search_field' => 'name_l'
);
Version 1.3! Should I change versions? I also just found out that in MY_fuel_modules.php, the 'search_field' parameter only works if its value is identical to 'display_field.' In my case, I want to sort by date but display the title, so it's not effective to have them be the same. Is this a known issue?
Comments
public function display_name($values) { // your custom code here }
But perhaps not...
I added this to my module.php, but it isn't doing anything? I tried to put a die() inside of it, but the die() did not execute, so for some reason it's not even going through the function. Do I have to put it elsewhere or do something special to make the module see it?
public function display_name($values){ if(!empty($values['id'])){ $getname = $this->attorneys_model->find('one', 'id ='.$values['id']); $values['display_name'] = $getname->name_f.' '.$getname->name_m.' '.$getname->name_l; return $values; } }
In MY_fuel_modules.php, I tried to get rid of the display_field, but it didn't make the function execute.
$config['modules']['attorneys'] = array( 'preview_path' => 'attorneys/{slug}', 'display_field' => 'name_l', 'search_field' => 'name_l' );
I also just found out that in MY_fuel_modules.php, the 'search_field' parameter only works if its value is identical to 'display_field.' In my case, I want to sort by date but display the title, so it's not effective to have them be the same. Is this a known issue?
Try setting the default_col and default_order parameter to have the default table sorting be different then the display_field