Drag and Drop from a file-upload generates the wrong link


I guess the picture helps to understand the issue:

I am uploading a file. I drag-and-drop it in the textfield (type: editor). The article renders like this:


It looks ok, but the file in the text is linking to my internal page on my localhost (http://kirby/panel/pages/blogs+woran-erkenne-ich-corona/files/coronaerkennen.pdf), not the correct domain. The button under the text is working as expected.

Perhaps that is even the intended behaviour? If so: How do I add a clickable link inside the text that starts a download of the PDF?

Here is the code of the blogpost. The issue is inside the

                <?= $subpage->text()->blocks() ?>

so I guess that my HTML/PHP is not really relevant here. But who knows.

  <div class="card-body">

            <h3 class="card-title"><?= $subpage->title() ?></h3>


                <?= $subpage->text()->blocks() ?>


            <div class="container bg-gradient rounded">

                <?php if ($file = $subpage->downloads()->toFile()) : ?>

                    <h5 class="lead mt-5 text-black">Passende Downloads</h5>

                    <?php $dateien = $subpage->downloads()->toFiles();

                    foreach ($dateien as $datei) : ?>

                        <a href="<?php echo $datei->url() ?>" download="<?php echo $datei->filename() ?>" class="btn btn-primary mt-2">

                            <svg class="bi" width="24" height="24">

                                <use xlink:href="<?= $kirby->url('assets') ?>/icons/bootstrap-icons.svg#info-square" />


                            <?php echo $datei->name() ?>


                    <?php endforeach ?>

                <?php endif ?>



Hm, I’m not sure if this is even supposed to work, because there is no file block type. There is a feature request for a file block type: https://github.com/getkirby/editor/issues/223

Please feel free to create an issue on GitHub, though.

For the moment, you could create your own file block tag or use a kirbytag block instead.

That would be loosing the features of the editor, right?

In that case I will stick to create a Link-list with PHP as before and what for Kirby 3.6 or something :stuck_out_tongue:

BTW: I simply expected this to work, it feels like an intuitive thing to do. I will open a feature request

Thanks for your quick reply on a sunday

Issue: https://github.com/getkirby/ideas/issues/608

Thanks, I moved it to the editor repo-