How to get link from kirbypanel to php

Hello everyone,

I want to make an image-wrapper-div. I found a plugin that lets me do that via a snippet.

https://github.com/rasteiner/k3-image-tag

snippets/imagetag.php

< div class=“image-wrapper”>
< a href="" data-fancybox=“page”>
< img src="<?= $image->resize(150)->url() ?>" alt="<?= html($alt) ?? $image->alt()->html() ?>" />
< /a>
< /div>

The custom tag is called div-image.

It works fine, but my question is:

How do I pass the link from the kirby panel to the < a >-tag in the snippet? Is there a $php-variable for this?

Note: The link will adress a subpage.

kirbypanel-text

Hello this is my image:
(div-image: face_02.jpg width: 25% link: /ensemble/gunnar)

Cheers
~Felix

Hi!

According to the readme of that plugin:

All attributes specified in the tag are extracted to variables.

…so the attribute link from your kirbytag becomes $link in the snippet, etc.:

<a href="<?= $link ?>" data-fancybox="page">

Perfect! Many thanks for the ultra quick reply.