rainlab/blog-plugin

Categories translated slug issue

Closed this issue · 6 comments

az-vm commented

Hello!

First thank you for this amazing plugin.

I´m facing the problem only in categories, not in posts, with the translated slug on front end side.

When we change locale it don´t change the url to the translated slug defined on the categories.

For example:
www.domain.com/en/categorie/en_slug
www.domain.com/es/categorie/es_slug

When we are on:
-> www.domain.com/en/categorie/en_slug
-> and change the locale to (ES)
it shows: www.domain.com/es/categorie/en_slug

and trowns a categorie not found on page.

What could it be ?

Kind Regard´s

az-vm commented

Hello @daftspunk

Any update on this bug ?

Kind Regard's

This is a known issue with the translate plugin, and we are working on a solution.

az-vm commented

Thank you @daftspunk

Hello @daftspunk
I am having the same issue in ocms v3

is there any solution for that?

Dont worry I have found the solution. this Event listener did the trick

Event::listen('cms.sitePicker.overrideParams', function($page, $params, $currentSite, $proposedSite) {
     if ($page->baseFileName == 'your-page-filename') {
          return YourModel::overrideParams($params, $currentSite, $proposedSite);
      }
});

Thanks @zakir1929

This should solve it for everyone: 9c23336