Error in custom block on server: syntax error, unexpected identifier "version"


i am working with a custom block and on my localhost everything works fine. Now I just uploaded the site to a webserver and my custom block does not get rendered. It says inside a p tag: Block error: "syntax error, unexpected identifier "version"" in block type: "buttons"

I have no idea what it means. “Buttons” is my custom block.

Could you post the code for your block snippet, please?


<section id="<?= $block->ide() ?>">
    <img class="cover" src="<?= $block->foto()->toFile()->url() ?>">
    <div class="button-box">
        <?php $buttons = $block->buttons()->toStructure(); ?>
        <?php foreach ($buttons as $button): ?>
            <a class="button <?= $button->class() ?>" href="<?= $button->link() ?>">
                <?= $button->text() ?>
        <?php endforeach ?>
    <div class="download">
        <a class="download-close" href="javascript:void(0)">
            <?xml version="1.0" encoding="utf-8"?>
            <svg version="1.1" id="Ebene_1" xmlns="" xmlns:xlink="" x="0px" y="0px"
                viewBox="0 0 38.6 38.6" style="enable-background:new 0 0 38.6 38.6;" xml:space="preserve">
            <style type="text/css">
            <line class="st0" x1="1.5" y1="36.9" x2="36.9" y2="1.6"/>
            <path class="st1" d="M-0.8,33.7"/>
            <line class="st0" x1="1.5" y1="1.6" x2="36.9" y2="36.9"/>
        <?php foreach($block->downloads()->toFiles() as $file): ?>
            <a class="download-link" href="<?= $file->url() ?>"><?= $file->filename() ?> – <?= $file->niceSize() ?></a>
        <?php endforeach ?>

Okay, now I get the Kirby error page and it highlights the XML line.

Just remove it, not needed

1 Like

Thank you!