Hi all, I am currently working on a model for a table called services. I want to join the services table on the table fuel_pages. Can anybody help me to create a dropdown field containing the id (key) and the location (value) from fuel_pages.
I'm assuming you are wanting to do this in the CMS form for creating a services record correct? If so, the easiest way may be to just add the $foreign_keys property to your services model like so: public $foreign_keys = array('page_id' => array(FUEL_FOLDER => 'pages_model'));
Thank you for the fast answer!. That did the trick. Is it also possible to add a where clause on it? So I can get only the pages where the layout is equal to "service"?
Comments
public $foreign_keys = array('page_id' => array(FUEL_FOLDER => 'pages_model'));
Is it also possible to add a where clause on it? So I can get only the pages where the layout is equal to "service"?
https://github.com/daylightstudio/FUEL-CMS/tree/1.0
public $foreign_keys = array('page_id' => array(FUEL_FOLDER => 'pages_model'), 'where' => array('layout' => 'service'));