I am trying to write module that displays entries from a channel. I have not been able to find a function that does this. There is an Channel API only has Update, Delete, Submit, etc but no fetch. I am just wanting to be able to be able to display all the entries from one channel and be able to order on different fields.
I know that I could use the SQL function with Codeigniter. But I know that channel data, fields, etc are spread over several tables.
Does anyone have any suggestions?
Thanks Aaron
Your module class can extend the Channel Module class. Then just implement your own entries method to implement the extra functionality you want and then call: $return_data = parent::entries();.
You will need to require the Channel module’s class file with require_once APPPATH.”modules/channel/mod.channel.php”;.
Inside your entries method you can use the $this->EE->TMPL->tagparams array to pass data to the parent’s entries method. For example, $this->EE->TMPL->tagparams[‘orderby’] = ‘some field name here’;.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.