# Slug field for default language in Kirby 3.6 not working

**URL:** <https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175>\
**Category:** Questions\
**Tags:** v3\
**Created:** [December 7, 2021, 8:07am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175 "2021-12-07T08:07:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartvandebiezen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bartvandebiezen/32/13885_2.png) [@bartvandebiezen](https://forum.getkirby.com/u/bartvandebiezen)\
**Post date:** [December 7, 2021, 8:07am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/1 "2021-12-07T08:07:25Z")

</div>

Hi, I just updated Kirby to 3.6 on my local server and found a problem with the website I am working on. I use a slug field also for the default language (Dutch), because I like to keep the structure in English, similar to the template names and code. I don’t like to mix languages. But after updating to 3.6, the slugs field in the Dutch files don’t work anymore. How could I solve this other than renaming all the folders?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 7, 2021, 8:14am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/2 "2021-12-07T08:14:57Z")

</div>

> [@bartvandebiezen](#):
>
> I use a slug field also for the default language (Dutch)

The slug field for the default language is no longer supported in 3.6.

> Slugs in multi-language setups

> - Slugs in content files of the default language will be ignored. The slugs for the default language are now only decided by the folder names.

> To check if you are affected by this, you can use our **[migration plugin](https://github.com/getkirby/kirby/releases/download/3.6.0/content-migration-checker.zip)**. Place it in `site/plugins` and visit any frontend page of your Kirby site to check if you need to migrate some of your pages. We have tested the plugin in Kirby 3.5 and 3.6, so you can use it before or after the upgrade.

---

<div class="post-metadata">

**Author:** ![bartvandebiezen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bartvandebiezen/32/13885_2.png) [@bartvandebiezen](https://forum.getkirby.com/u/bartvandebiezen)\
**Post date:** [December 9, 2021, 4:32pm UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/3 "2021-12-09T16:32:35Z")

</div>

Sad to see it removed. Any chance it is coming back? It also makes it really difficult to switch the main language in the future, less flexible.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 9, 2021, 4:46pm UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/4 "2021-12-09T16:46:39Z")

</div>

I actually don’t know why it was removed, maybe it caused problems of some sort. But I agree, it was very useful.

---

<div class="post-metadata">

**Author:** ![bartvandebiezen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bartvandebiezen/32/13885_2.png) [@bartvandebiezen](https://forum.getkirby.com/u/bartvandebiezen)\
**Post date:** [December 15, 2021, 11:43am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/5 "2021-12-15T11:43:40Z")

</div>

Ok. Sorry to say, but then I need to keep using 3.5.x.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [December 15, 2021, 9:04pm UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/6 "2021-12-15T21:04:14Z")

</div>

Hi Bart,

Sorry to hear that you miss this feature. To be completely honest, we didn’t expect that this undocumented behavior was actually used on purpose in projects – especially because the Panel doesn’t store pages with `Slug` fields in the default language.

The reason why we removed this behavior is that the removal increases page lookup performance. Large sites benefit a lot from this as the lookup time increases exponentially with large content trees. You can find our original discussion on the change on GitHub:

> <https://github.com/getkirby/kirby/pull/2763>
>
> \## Describe the PR
> 
> In a multi-language setup, finding a Page in a Pages colle…ction by slug is unnecessary for the default language. The existing behavior means that nonexistent ids/slugs incur a full loop iteration that will never actually return a result.
> 
> Because the \`id\` for any page \_is\_ constructed from default-language slugs, the initial lookup with \`-\>get\` should be sufficient.
> 
> \## Ready?
> 
> 
> 
> \- \[x\] Added unit tests for fixed bug/feature
> \- \[x\] Passing all unit tests
> \- \[\] Fixed code style issues with CS fixer and \`composer fix\`
> \- \[\] Added in-code documentation (if needed)

How do you manage your content and what does your workflow look like?

---

<div class="post-metadata">

**Author:** ![bartvandebiezen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bartvandebiezen/32/13885_2.png) [@bartvandebiezen](https://forum.getkirby.com/u/bartvandebiezen)\
**Post date:** [December 16, 2021, 9:24am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/7 "2021-12-16T09:24:03Z")

</div>

Thank you for your reply. Nice to see there is so much discussion about these kind of things. Just my 2 cents:

1. This approach makes it almost impossible to switch the default language. For example if a Dutch website grows and wants to go more global and make English the default language… 😬 I would expect Kirby to be more flexible. Flexibility is one of the reasons I use Kirby.

2. The performance improvement only applies to the default language which makes other languages somehow second-class citizens 🤔

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 16, 2021, 10:28am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/8 "2021-12-16T10:28:55Z")

</div>

It should still be possible to reintroduce this feature via a custom route and url method.

> [@bartvandebiezen](#):
>
> This approach makes it almost impossible to switch the default language.

Since it’s not possible to switch the default language via the Panel, switching the default language needs some more care, anyway. A script to change the slugs will help here as well should the need arise.

How did you add the slug to the default language, via a hook?

---

<div class="post-metadata">

**Author:** ![bartvandebiezen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bartvandebiezen/32/13885_2.png) [@bartvandebiezen](https://forum.getkirby.com/u/bartvandebiezen)\
**Post date:** [December 16, 2021, 10:52am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/9 "2021-12-16T10:52:28Z")

</div>

For now I use it without the panel, just in the txt files. For example, the client prepares a product based on the file structure of an example product and I do a final check (image format and sizes, missing SEO content, translations) before I publish it with the editor.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [December 17, 2021, 7:07am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/10 "2021-12-17T07:07:04Z")

</div>

I agree with Sonja that switching default languages requires more care. Consider fields with `translate: false` that need to be moved to the new default language for example. So a migration script is needed in any case.

The question is always how much to prepare for the future and how much to build for the present moment. You never know what the future may bring, but IMO it‘s not useful to prepare for all sorts of scenarios as this will introduce a lot of complexity. And in the end the future may turn out completely different than expected anyway.

Which brings me to…

> [@bartvandebiezen](#):
>
> The performance improvement only applies to the default language which makes other languages somehow second-class citizens 🤔

Well, it‘s a bit like denying the pay rise of a coworker only because they will then get more than you. 😅

Previously the default _and_ secondary languages needed to make the lookup, which slows down all languages. Now the default language benefits, which is a lot better than keeping it slow just so it‘s “fair” compared to the secondary languages. 😉

For the default language it’s also more important as this language is used for page lookups e.g. in the `pages` field.

> [@bartvandebiezen](#):
>
> For now I use it without the panel

The issue is that this `Slug` setup can never work with the Panel as we would need to display two fields for the folder name and the slug. Users won’t care about the folder name as it’s just an internal implementation detail of the filesystem storage, so exposing this field doesn’t make much sense from a UX perspective. But it would be needed as the folder name would no longer be equal to the default language slug.

---

<div class="post-metadata">

**Author:** ![bartvandebiezen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bartvandebiezen/32/13885_2.png) [@bartvandebiezen](https://forum.getkirby.com/u/bartvandebiezen)\
**Post date:** [December 17, 2021, 8:00am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/11 "2021-12-17T08:00:16Z")

</div>

@lukasbestle Fair points 🙂 You convinced me, although of course it was not needed to convince me 😉 For the second-class citizens I was more thinking about if this would postpone a solution for the other languages. But fair enough.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [December 17, 2021, 8:18am UTC](https://forum.getkirby.com/t/slug-field-for-default-language-in-kirby-3-6-not-working/24175/12 "2021-12-17T08:18:28Z")

</div>

With the unique ID system on our roadmap it will be possible to index the page tree and access pages much faster. It is certainly a possibility to use the same system to optimize lookup times.
