SiteSearch

Adds global search capabilities to October CMS

Back to SiteSearch Support

Responsive
Responsive

Hi there,

Love your plugin!

Any plans to support October v3 and in particular Tailor generated content?

Cheers,

Cy

OFFLINE
OFFLINE

Yes, absolutely! I just did not find the time to implement the feature yet, but it is on the roadmap.

In the meantime, you can implement it yourself in our app/Provider.php:

    Event::listen('offline.sitesearch.query', function ($query) {
            $controller = \Cms\Classes\Controller::getController() ?? new \Cms\Classes\Controller();

            $items = \Tailor\Models\EntryRecord::inSection('Your\Section')
                ->applyPublishedStatus()
                ->where(function ($q) use ($query) {
                    $q->where('title', 'like', "%{$query}%")
                        ->orWhere('content', 'like', "%{$query}%")
                        ->orWhere('some_other_field', 'like', "%{$query}%");
                })
                ->get();

            $results = $items->map(function ($item) use ($query, $controller) {
                $relevance = mb_stripos($item->title, $query) !== false ? 2 : 1;

                return [
                    'title' => $item->title,
                    'text' => $item->content,
                    'url' => $controller->pageUrl('target-page-filename', ['slug' => $item->slug]),
                    'thumb' => optional($item->image)->first(),
                    'relevance' => $relevance,
                ];
            });

            return [
                'provider' => 'Project',
                'results' => $results,
            ];
        });
vast.trout.hxwk99903
vast.trout.hxwk99903

@Basketball Bros

Yes, we plan to support October CMS v3, and we definitely want to support Tailor-generated content. The main work is around updating the plugin for the v3 architecture and adding a proper search provider for Tailor records so that they can be indexed and returned alongside regular CMS pages and other supported content. It’s on the roadmap, although I wouldn’t want to promise a specific release date yet.

1-3 of 3