Hi there! I am a bit lost.
What I like to achieve is sth I read a few times here but can’t find a concrete answer:
I have a multilingual page setup (en default, de). But only the blog section should behave differently. We will post some articles only in English, some only in German, and some will be translated.
So /blog should only list English posts, /de/blog should only list German posts.
I found @texnixe ’s solution for this, but it seems outdated. I downloaded the latest starter kit. Since I am a php newbie, I would love to hear suggestions from you. Thanks in advance. – Martin
Does it mean I only can create a German-only blog post (en is default lang) without the panel? Because when adding a German blog post via panel, a en text file is created in every case.
If this is the case, I wonder how I could filter blog post like “when “text” field is not empty”?
This might get a bit tricky with the pagination, I just had a strange behaviour in the langkit. Will check later. But you’ll probably have to use a custom page method to get that right.
I have downloaded the original Kirby Langkit version 2.4.0 and installed it on XAMPP with Windows.
Then I have changed the default language to German and changed the German ‘url’ to ‘/de’ in the file \site\config\config.php.
If I go to “/panel/pages/blog/content/edit”, I see this content file article.en.txt with the fields of the blueprint default.yml, because there is no content file article.de.txt. It is unimportant whether in my profile DE or EN is selected as language. Also, the language whose fields appear in the panel is not relevant to this behavior.
I think this is an error in the actual panel version. What do you think @texnixe?
@martinthiemann:
So I have to answer your question with: yes!
To simulate his problem, I only changed DE and EN related to the quoted problem description from the previous post, so we can use the default download as I sayed in my post.
@anon77445132: If you change the default language, you have to rename the text files if you want to use the panel. The panel always creates the textfile for the default language automatically.
Sorry @texnixe, I think that was not the question of @martinthiemann. [quote=“martinthiemann, post:4, topic:5882”]
Does it mean I only can create a German-only blog post (en is default lang) without the panel?
[/quote]
@anon77445132: As I said above, the panel always creates the textfile for the default language when you create a page in a non-default language. This was to confirm @martinthiemann’s question.
But that not really the important part here, the question is how to filter content to get only the content in a particular language, no matter in what language that content was created and to prevent the fallback to the default language.