Populating drop down list in FUEL CMS Edit page
Hi there
I have a table which is a joining table for several others. How do I display the correct join parameter in the the select drop down in the edit page within the advance module CMS where is says 'Select another'?
At the moment it's just displaying the row id which is not what I want.
Any guidance would be very much appreciated.
Peace, love and flowers...
Comments
public function form_fields($values = array(), $related = array()) { $fields = parent::form_fields($values, $related); $fields['my_select_field']['options'] = array(1 => 'value1', 2 => 'value2'); return $fields; }
Thanks for getting back to me so promptly, really appreciated!
I'm referring to the actual default 'Select another' option that appears in the Fuel CMS admin interface in the same row as the 'Save', 'Unpublish' etc, etc buttons...
Cheers!
One final query relating to this, how do I similarly update the selected name in the breadcrumbs trail at the top of the page:
Model name > Record being edited
...it currently it defaults to the first field with content, (I think as defined by display_field parameter in the module config).
The field I want to use it joined to the model table, how would I reference that in the display field?
Cheers!
$this->db->join('my_table', 'my_table.id = my_other_table.id', 'left');
I've done all the joins as required in my module, but how do I reference them in the xxxx/config/xxxx_fuel_modules.php file?
$config['modules']['xxxx'] = array(
'display_field' => 'joined_table_field_I_want_to_reference'
);
Sorry if I'm not being too clear!
function _common_query() { parent::_common_query(); $this->db->select('my_table.*, my_other_table.id as other_id'); $this->db->join('my_table', 'my_table.id = my_other_table.id', 'left'); }
I will let you know how I get on...
Cheers!