Stillat / tidal

Tidal is a free, open-source, documentation-focused starter kit for @statamic. Tidal supports multiple projects, and multiple versions per-project.
GNU General Public License v3.0
0 stars 0 forks source link

Search page is 404 #2

Closed modstore closed 1 month ago

modstore commented 3 months ago

I've just installed this starter kit and I'm liking it, but search doesn't work. I'm new to statamic so I'm not sure if I need to enable/configure anything to make the search endpoint valid, but when I do a search, it takes me to /search?q=whatever and that is a 404 page.

Julian4D commented 1 month ago

I am getting the same issue, not really a fix, but I ran php artisan statamic:search:update and then replaced in search.antlers.html the documentation:results tag with:

        {{ search:results index="default" }}
              {{ if no_results }}
                  <h2>No results found for {{ get:q }}.</h2>
              {{ else }}
                  <a href="{{ url }}">
                      <h2>{{ title }}</h2>
                      <p>{{ description | truncate:180 }}</p>
                  </a>
              {{ /if }}
          {{ /search:results }}

Thats not really a fix though but does return results. Are there are other options I am missing in config? @JohnathonKoster can you assist with this?

JohnathonKoster commented 1 month ago

I am getting the same issue, not really a fix, but I ran php artisan statamic:search:update and then replaced in search.antlers.html the documentation:results tag with:

        {{ search:results index="default" }}
              {{ if no_results }}
                  <h2>No results found for {{ get:q }}.</h2>
              {{ else }}
                  <a href="{{ url }}">
                      <h2>{{ title }}</h2>
                      <p>{{ description | truncate:180 }}</p>
                  </a>
              {{ /if }}
          {{ /search:results }}

Thats not really a fix though but does return results. Are there are other options I am missing in config? @JohnathonKoster can you assist with this?

This does not sound like the same issue, as you are able to see the search page in order to make templating changes. The custom Tag shipped with this starter kit utilizes a custom search provider. You can learn more about configuring that here: https://stillat.com/documentation-search/v1/index-configuration

JohnathonKoster commented 1 month ago

@modstore You should be able to add this to your routes/web.php file to resolve this (corrected for new installs, however):

<?php

use Illuminate\Support\Facades\Route;

Route::statamic('search', 'search');

Afterwards, run php artisan route:clear to ensure you don't have any cached route issues 👍