Skip to content

Conversation

@Maverick770
Copy link

I've implemented several major enhancements to the SimpleSearch plugin:

  1. Search Suggestions (Autocomplete):

    • This provides live search suggestions as you type.
    • It's powered by AJAX and configurable via the admin panel (you can enable it, set the minimum query length, and the maximum number of suggestions).
  2. AJAX Search Results Display:

    • I've added an option to display full search results via AJAX directly on the current page, without a full page reload.
    • You can configure this via the admin panel (enable/disable).
  3. Search Term Highlighting:

    • I've made it so query terms are automatically highlighted in search result titles and content snippets using <mark> tags.
    • This works for both AJAX and traditional results.
    • I've added default styling for <mark> tags, which you can customize via CSS.
  4. Pagination for Results:

    • I've implemented pagination for both AJAX-loaded results and traditional server-rendered results pages.
    • The number of results per page is configurable via the admin panel.
  5. Admin GUI Enhancements:

    • I've updated the plugin blueprints (blueprints.yaml) with toggles and settings for all new features.
  6. Documentation:

    • I've updated the README.md to reflect all new functionalities and configuration options.

These features significantly modernize the SimpleSearch plugin, improving your experience and providing more flexible search capabilities for Grav CMS sites.

I've implemented several major enhancements to the SimpleSearch plugin:

1.  **Search Suggestions (Autocomplete):**
    *   This provides live search suggestions as you type.
    *   It's powered by AJAX and configurable via the admin panel (you can enable it, set the minimum query length, and the maximum number of suggestions).

2.  **AJAX Search Results Display:**
    *   I've added an option to display full search results via AJAX directly on the current page, without a full page reload.
    *   You can configure this via the admin panel (enable/disable).

3.  **Search Term Highlighting:**
    *   I've made it so query terms are automatically highlighted in search result titles and content snippets using `<mark>` tags.
    *   This works for both AJAX and traditional results.
    *   I've added default styling for `<mark>` tags, which you can customize via CSS.

4.  **Pagination for Results:**
    *   I've implemented pagination for both AJAX-loaded results and traditional server-rendered results pages.
    *   The number of results per page is configurable via the admin panel.

5.  **Admin GUI Enhancements:**
    *   I've updated the plugin blueprints (`blueprints.yaml`) with toggles and settings for all new features.

6.  **Documentation:**
    *   I've updated the `README.md` to reflect all new functionalities and configuration options.

These features significantly modernize the SimpleSearch plugin, improving your experience and providing more flexible search capabilities for Grav CMS sites.
@Maverick770 Maverick770 reopened this May 29, 2025
@rhukster
Copy link
Member

This does sound interesting! The only thing i am concerned about is backwards compatibility, all this funtionality is great, but people need to be able to update their existing sites that already have simplesearch integrated, and will expect things not to break.

have you tested with say Blog Site skeleton or something similar? https://github.com/getgrav/grav-skeleton-blog-site

if it's not backwards compatible, it could still be OK if ther's 'new' twig templates that can be used and leave the old twig templates to function as they always have? Just an idea. I'll need to check this out and investigate further.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants