• Resolved Erik Molenaar

    (@erikmolenaar)


    Hi Andrea,

    Would it be possible to customize the search result text snippets? (like Relevanssi does so nice):

    – Limit the amount of words in the text
    – Nice feature: highlight the search terms

    Like Relevanssi’s settings -> https://screencast.com/t/puF4ufpDF
    Result on the front-end -> https://screencast.com/t/fQ1EHUAK

    I think with these kind of options, you can really polish how to present the search results! I hope it is of use to improve your plugin ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Andrea Landonio

    (@lando1982)

    Hi Erik, the first one absolutely! It’s easy… the second one it’s a good improvement.. I’ll try..

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Erik, I’ve a question for you. Do you want text “limit” on API or in search results snippet? In other hands, in the API it’s correct to have this “control” because I give back to you a JSON with the “post_content” field “truncated”. In the result snippet I’m using the default WP themes (twentyfifteen, twentysixteen, etc) that show the excerpt automatically (not the post content), if you are using a custom template you can improve text truncate by your own, isn’t it?

    Let me know if I have correctly understood your request…

    Thread Starter Erik Molenaar

    (@erikmolenaar)

    Hi Andrea

    I think you should handle if from the theme instead of the API.
    This will open more options, for example highlighting the search term within the search result text snippet.

    It would just be nice to have only a simple checkbox within your plugin settings to set this to an X amount of words. Or maybe I am just spoiled by al the options offered by Relevanssi to ‘polish’ the search results to my liking ??

    Plugin Author Andrea Landonio

    (@lando1982)

    Thanks Erik, the text limit is already developed on my environment, with selection of X words/chars. When ready the highlight I can release a new plugin version.. ??

    Thread Starter Erik Molenaar

    (@erikmolenaar)

    Awesome! Looking forward to it ??

    Plugin Author Andrea Landonio

    (@lando1982)

    Erik, release 1.1.0 is ready!!! With hit highlighting and text limits….

    Thread Starter Erik Molenaar

    (@erikmolenaar)

    Hi Andrea,

    That is some awesome news! Thanks ??
    The highlighting works perfectly, but the text limiting (word nor chars) does not seem to function.

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Erik,

    in which way you are using my plugin? with a custom template for search every items? es: content-search.php?

    Thread Starter Erik Molenaar

    (@erikmolenaar)

    Hi Andrea

    Thanks for your prompt reply.

    1. “Content box type” is set to “Plugin based”
    2. “Use plugin search page” is set to ON

    Plugin Author Andrea Landonio

    (@lando1982)

    I’ll test your configs… it’s very strange..

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Erik, in my environment all is ok.. ??
    Let’go deeper… are you using a custom theme? if not, the plugin automatically choose a template similar to twenty-XX WordPress standard theme.. otherwise you can insert this code:

    <?php echo acs_highlight_text( acs_truncate( get_the_content() ), ACS::get_instance()->get_key() ); ?>

    Let me know..

    Thread Starter Erik Molenaar

    (@erikmolenaar)

    Hi Andrea,

    I am using a custom theme.

    In which template should I place this code? As the plugin is using the content box from its own files and I use the plugin search page this is a bit confusing for me :-/

    If you like I can show you the staging site. Please send me an email at info [at] erikmolenaar.nl so we can investigate this further?

    Thanks!

    Plugin Author Andrea Landonio

    (@lando1982)

    I have sent to you an e-mail.. ??

    Plugin Author Andrea Landonio

    (@lando1982)

    No responses

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Customize Search Result text snippets’ is closed to new replies.