daylightstudio / FUEL-CMS-Blog-Module

A blog module for FUEL CMS
18 stars 18 forks source link

Support multilanguage blog post #10

Open rmutia opened 10 years ago

rmutia commented 10 years ago

How to make multi language blog post with this module? Have I modified the source code and database structure?

daylightstudio commented 10 years ago

I'd recommend the following:

  1. Add a language field to the fuel_blog_posts table (and maybe the fuel_blog_categories table)
  2. Setup the queries to look for the appropriate language. The Fuel_blog::_publish_status() method is used in most of the methods needed for rendering the posts on the front end and you could add something like $where['language'] = $this->CI->fuel->language->detect(); as an extra where condition or create another method that is included in those same methods right along side the calls to _publish_status (e.g. Fuel_blog::_set_language(); $this->CI->blog_posts_model->db()->where('language', $this->CI->fuel->language->detect());
rmutia commented 10 years ago

i've tried your solution, and then comes problem:

url blog is : http://[mydomain]/blog/[post-title] but when I switch language and put lang segment in url: http://[mydomain]/[lang]/blog/[post-title], --> http://domain/id/blog/post-title, the result is 404 not found

but when I switch language in module Page, the result is page content in that language