u13712
November 22, 2022, 12:28pm
1
Hello!
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.
texnixe
November 22, 2022, 1:02pm
2
Could you post the code for your block snippet, please?
u13712
November 22, 2022, 1:07pm
3
snippets/blocks/buttons.php
<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() ?>
</a>
<?php endforeach ?>
</div>
<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="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/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">
.st0{fill:none;stroke:#ffffff;stroke-width:4;stroke-miterlimit:10;}
.st1{fill:none;stroke:#ffffff;stroke-width:4;stroke-miterlimit:10;}
</style>
<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"/>
</svg>
</a>
<?php foreach($block->downloads()->toFiles() as $file): ?>
<a class="download-link" href="<?= $file->url() ?>"><?= $file->filename() ?> – <?= $file->niceSize() ?></a>
<?php endforeach ?>
</div>
</section>
u13712
November 22, 2022, 1:21pm
4
Okay, now I get the Kirby error page and it highlights the XML line.
texnixe
November 22, 2022, 1:28pm
5
Just remove it, not needed