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

Add default slug to translated slugs array #268

Closed
2 of 6 tasks
samuells opened this issue May 4, 2020 · 2 comments
Closed
2 of 6 tasks

Add default slug to translated slugs array #268

samuells opened this issue May 4, 2020 · 2 comments

Comments

@samuells
Copy link
Contributor

samuells commented May 4, 2020

The feature would affect: (check one with "x")

  • app.storyblok.com (CMS - Interface)
  • api.storyblok.com (CMS - Content Delivery API)
  • mapi.storyblok.com (CMS - Management API)
  • capi.storyblok.com (Commerce - API)
  • Commerce - Interface
  • Other

Is your feature request related to a problem? Please describe.
The translated slug array of app translated slugs doesn't contain the default slug information. In the case of creating multilang app/website is it not possible to find out the slug of the default story without another API request. Check how the JSON looks like, if I use 2 language - default and english:

"translated_slugs": [
      {
        "path": "en-folder/en-story",
        "name": "en-story-name",
        "lang": "en"
      }
    ]

Describe the solution you'd like
I would expect that JSON code would deliver also information about the default/original story slug.

story: {
  "translated_slugs": [
      {
        "path": "en-folder/en-story",
        "name": "en-story-name",
        "lang": "en"
      },
      {
        "path": "default-folder/default-story",
        "name": "default-story-name",
        "lang": "default"
      }
  ]
}

I would expect also to have additional property on the story default_full_slug which would contain original/default slug of entry. Check the code:

story: {
  "full_slug": "en/en-folder/en-lang",
  "default_full_slug": "default-folder/default-lang",
}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@lukas-a-brand
Copy link

I totally agree that part of the translated slugs app is missing and is a must have to accomplish some best practice functionality.

e.g.:

  • You would need it to be able to change the language and redirect the user on a page to the correct translated language alternative slug.

  • You need it to build the correct hreflang alternatives on a given page.

For these two use cases alone it would suffice to have the latter described "default_full_slug" property with the default full slug always in the story.

Happy to help if I can - but that is a must have for me, and need it soon :)

@onefriendaday
Copy link
Member

Has been released: https://www.storyblok.com/cl/default-full-slug

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

3 participants