Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localized page with a non localized content entries #157

Open
proxygear opened this issue Aug 29, 2019 · 2 comments
Open

Localized page with a non localized content entries #157

proxygear opened this issue Aug 29, 2019 · 2 comments

Comments

@proxygear
Copy link

Context

I have a the following content type :

slug: departments
name: Departments
order_by: code
order_direction: asc
label_field_name: code
fields:
- code:
    label: Code
    type: string
    localized: false
    required: true
- name:
    label: Département
    type: string
    required: true

As you can see, none of the fields are localized.

Code

https://github.com/locomotivecms/steam/blob/master/lib/locomotive/steam/middlewares/templatized_page.rb

      def fetch_content_entry(slug)
        if type = content_type_repository.find(page.content_type_id)
          # don't accept a non localized entry in a locale other than the default one
          return nil if type.localized_names.count == 0 && locale.to_s != default_locale.to_s

          decorate_entry(content_entry_repository.with(type).by_slug(slug))
        else
          nil
        end
      end

I don't get why we shouldn't have a localized page for a non localized content.
To get around that, I just added a non editable, non required localized field.
It's just strange.

@did
Copy link
Member

did commented Nov 20, 2019

hi @proxygear, I met the exact same problem 2 days ago on a Locomotive site. I think the problem is related to SEO. Basically, Google doesn't really like when a site has 2 different pages with the exact same content.
Right now, I don't know what the right behavior should be. What's your opinion?

@proxygear
Copy link
Author

proxygear commented Nov 22, 2019

As you can see in my example, it's a list of French department.
So I want to have :

  • /departements/60
  • /departements/en/60
  • /departements/de/60

The code and the name of the departement stay the same (It would be the same with city names). The reste of the page content gonna be translated to the targeted language.
I guess Google will not have a problem with it.
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants