Joining on fuel_pages

edited October 2012 in Share
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.

Thank you

Comments

  • edited 1:27PM
    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'));
  • edited 1:27PM
    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"?
  • edited 1:27PM
    There is in the 1.0 beta branch (along with a slew of other new features):
    https://github.com/daylightstudio/FUEL-CMS/tree/1.0

    public $foreign_keys = array('page_id' => array(FUEL_FOLDER => 'pages_model'), 'where' => array('layout' => 'service'));
  • edited 1:27PM
    Thank you I will give it a try
Sign In or Register to comment.