new to fuelcms: is it possible to create a multilingual CMS?
I'm new to fuelcms but i developed a complex multilingual CMS-CRM using Codeigniter for frontend and ATK/Achievo as backend.
Is it possibile to merge all the functionality in FuelCMS? Expecially the backoffice i wonder if its possibile to create models in fuelcms in the same way i did with ATK/Achievo.
My main concern is the multilingual CMS, it has 2 main tables: content1 and content2.
- Content1 contains the common content shared parameters, foreign keys, but no strings.
- Content2 is joined to content1 on primary key content_id and contains the translated strings (title, description, slug, body, publish date, etc.)
I.e. when i edit a page i've a tab with general settings and a tab for each available translations (including the default language);
if tabs are not possibile a table will be ok too.
Is this replicable in fuelcms or i've to create a "view" in mysql and use that one as a "big table" for the model?
Thanks for any suggestions!
Antonio
Comments
http://docs.getfuelcms.com/installation/configuration
http://docs.getfuelcms.com/general/localization
https://ellislab.com/codeigniter/user-guide/libraries/language.html
It seems that relations are handled via a select combobox or with a shuttle-object (in has_many).
This works ok for a list of 100 records or such.
I've relations with 100.000 records and need a different approach because a SELECT or the shuttle does not work well and crash the browser or makes PHP out of memory.
Does fuelcms provide in the core some solution for this?
In ATK/Achievo i've a ajax search box that allow to search and then add it to a table that automatically grows.
http://ivaynberg.github.io/select2/
There is a blog post that you can use for a reference in creating a custom field type:
http://www.getfuelcms.com/blog/2013/12/17/creating-a-color-picker-custom-field
http://docs.getfuelcms.com/general/forms#association_parameters
As a starter, you could do something like the following:
1. Download the files from http://ivaynberg.github.io/select2/
2. Place the CSS files in an assets/css/select2 folder
3. Place the JS files in an assets/js/select2 folder
4. Add the following code to the fuel/application/config/custom_fields.php file:
$fields['tags'] = array( 'class' => 'MY_custom_fields', 'function' => 'select2', 'css' => 'select2/select2', 'js' => array( 'select2/select2', ), 'represents' => array('name' => 'tags'), );
5. Create a the file fuel/application/libraries/MY_custom_fields.php and place the following in it:
class MY_custom_fields { function select2($params) { $form_builder =& $params['instance']; $js = '<script type="text/javascript"> $(function(){ $(".field_type_tag").select2(); }) </script> '; $form_builder->add_js($js); $params['class'] = (!empty($params['class'])) ? $params['class'].' field_type_tag' : 'field_type_tag'; $params['type'] = 'select'; return $form_builder->create_select($params); } }
Now in your simple module's model, the form_fields method you can use the type of "select2" like the following:
function form_fields($values = array(), $related = array()) { $fields = parent::form_fields($values, $related); $fields['my_field'] = array('type' => 'select2'); return $fields; }
More on creating a simple module can be found here:
http://docs.getfuelcms.com/modules/tutorial
Still need to find a solution for the many-to-many
$params['multiple'] = TRUE;