Returning html in a table view column

,

In K5 it was possible to return html in a cell from a table view.

type: pages
layout: table
label: All pages
image: false
sortBy: date DESC
limit: 40
columns:
  author:
    label: Author
    width: 1/3
    value: "{{ page.userlink }}"
    type: html

with a Page Method plugin:

Kirby::plugin(
    name: 'Tribes/privacy-view',

    extends: [
        'pageMethods' => [
            'userlink' => function () {
                $user = $this->author()->toUser();

                if (!$user) {
                    return '';
                }

                $url = $user->panel()->url();

                        return '<a style="text-decoration: none;" href="' . $url . '" target="_blank" class="k-button" data-theme="blue" data-variant="filled" data-size="sm" data-has-icon="false" data-has-text="true">
                <span style="color: black;" class="k-button-text">' . $user->username() . '</span>
            </a>';

                );
            },

Now the cell returns plain html;

I don’t think I was able to find a solution in the migration guide, but I might be wrong.

Hi, queries with {{ }} get escaped, try {< page.userlink >} in the value instead. That one returns the raw html, so the method has to output safe markup.