Simple Module + Multiple Languages
I'm trying to build a "gallery" simple module to upload & manage artworks on a multilingual site.
I like how the pages module handles multiple languages (when you select a language, it changes the page variables so you can enter the same data for another language). I have been looking through fuel_pages_model.php and fuel_pagevariables_model.php, but I can't find anything regarding that feature. How can I leverage that feature for my own simple module?
I'm also trying to emulate the way FUEL handles data for multiple languages in my simple module. That is, I've set up my gallery table, and I also have a gallery_variables table. What file can I look at to understand how FUEL integrates these two tables on the admin interface?
I like the way FUEL pages work, so I wanted to try and do something similar for my own module. Trying not to reinvent the wheel!
Thanks!
Comments
What's throwing me is a function that gets called a lot: _process()
I've located it in \fuel\modules\fuel\controllers\module.php, but it throws errors if I try to access it from my model (in \fuel\application\models\), even if I require_once() the module.php file. What does _process() do?
If I add the _process function directly to my model file, I get this error:
( ! ) Fatal error: Maximum function nesting level of '100' reached, aborting!
In a simple module, how can I get the ID of the entry before I create it? In an on_after_save() function I'm trying to get the ID of the item that was saved in the save() function. If I call $this->model->save(), I get an infinite loop error.
public function on_after_save($values) { print_r($values); return $values; }
You are about to delete the item: 0
Though it deletes the proper entry from the DB, why does it say the item "0"? Where can I access that variable that's being outputted as 0?
http://docs.getfuelcms.com/modules/simple
Hi! I am returning to this code after a year and a half of not looking at it, and I'm coming up against a problem (of course). When I query my gallery model, it's only pulling the data from the gallery table. Could you please jog my memory re: how to make it automatically join with the data from the galleryvariables table to output it on the front end? Thanks!