Similar for Kirby 3 error

#1

Hi there!

Im try to implement Similar for Kirby 3 plugin
and stuck a little with this:

        <?php
        			$similarArticles = $page->similar([
        			  'index' => $page->siblings(false)->visible(),
        			  'fields'         => ['category' => 0.3, 'title' => 1],
        			  'threshold'      => 0.2,
        			  'delimiter'      => ',',
        			  'languageFilter' => true
        			]);
    ?>

When im try to load page, I have error
Whoops \ Exception \ ErrorException (E_NOTICE)
Array to string conversion

If I use simple way by one field it works fine:

'fields'         => 'tags',

Where I can be wrong?

0 Likes

#2

I know what the problem is and will fix it tomorrow.

0 Likes

#3

I pushed a new version, should be fixed now.

Note that using the title field is not really useful here, because the plugin only works with fields like select, multiselect or tags fields that contain either a single entry or a separator separated list of entries.

I would have to extend the plugin to make it work with full text.

1 Like

#4

Works great. Title I use just for testing.

0 Likes