How to add a second language for existing website with mp4, ogg, webm files?

I added a new language (EN) to an existing website, which was only available in one language (DE). I followed this article: Introduction | Kirby CMS

After I made the configurations, and renamed/added the existing .txt files, the website is showing quite okay, but mp4, webm, etc. are missing.

I tried to add those file types as secondary language as well, but then I’ve got an error.
Can someone please help me with that?


How are your files integrated into the site? I don’t quite understand what you mean with they are missing…

Thanks for your reply, and sorry for being too less specific.

The files are sitting in the ‘content’ folder, and they were integrated under snippets (e.g. header.php) with e.g. <?= $page->mp4_intro_video()->toFile() ?>, but they aren’t loaded in the website.

Maybe it could has something to do with the different url path, which I have now (…’/de’)? I just saw, that some of the assets I use, aren’t loaded, because the ‘<?= $site->url() ?>’ includes (…’/de’), but shouldn’t.

Do you have an idea, how I can fix that?

Thanks a lot

Ok, so they are coming from a field that is not “translated”. For field that only contain references to files which are the same in any language, you can set translate: false as a field property in your blueprints, which will then disable these field in all languages but the default language in the Panel, and on the frontend, such files should show up automatically.

Also, welcome to the forum @lun

Thank you, texnixe, and also jimbobrjames!

That’s a good point. I did that, but then I realized that the path to the .js and other relevant assets was wrong because of the language part /de or /en. Some relevant code in the .js was used to get the assets. When I changed the default language url to '/', it worked for the default language, but still in the english version the assets haven’t loading.

Therefore, I edited all the statements, where I try to get the assets from

<script src="<?= $site->url() ?>/assets/js/main.js"></script>


<script src="<?= $kirby->url('assets') ?>/js/main.js"></script>

So, now it’s working! Thanks a lot for your help! Always good to have someone, which is helping to check it from a different perspective…

Best regards,