New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search widget autosuggest returns full html #2647

Open
vanMeerdervoort opened this Issue Oct 3, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@vanMeerdervoort

vanMeerdervoort commented Oct 3, 2018

Type

  • Non critical bug

Problem description

The autosuggest in the search widget returns the entire page content as HTML

Steps to reproduce

go to the forkcms demo site, type a search in the search widget (top of page) see the result.

Expected behavior / Proposed solutions

Return the matching word instead of the complete html

@carakas carakas added this to the 5.4.1 milestone Oct 3, 2018

@carakas

This comment has been minimized.

Show comment
Hide comment
@carakas

carakas Oct 3, 2018

Member

normally it should return a summary, but that clearly doesn't happen

Member

carakas commented Oct 3, 2018

normally it should return a summary, but that clearly doesn't happen

@vanMeerdervoort

This comment has been minimized.

Show comment
Hide comment
@vanMeerdervoort

vanMeerdervoort Oct 3, 2018

why do you consider this an issue?

  1. It looks awful
  2. It is not helpful or userfriendly
  3. It is not expected behaviour -> one expects that an autosuggest returns links to the pages where the typed word is found, not the entire page (or even a summary for that matter) within the tiny autosuggest results field

Please see screenshots of the problem and expected behaviour here

vanMeerdervoort commented Oct 3, 2018

why do you consider this an issue?

  1. It looks awful
  2. It is not helpful or userfriendly
  3. It is not expected behaviour -> one expects that an autosuggest returns links to the pages where the typed word is found, not the entire page (or even a summary for that matter) within the tiny autosuggest results field

Please see screenshots of the problem and expected behaviour here

@vanMeerdervoort

This comment has been minimized.

Show comment
Hide comment
@vanMeerdervoort

vanMeerdervoort Oct 3, 2018

Fix is very easy ;)

In Search.js, replace line 73

return '<a><strong>' + data.value + '</strong><p>' + data.description + '</p></a>'

with

return '<a><strong>'+data.value +'</p></a>'

vanMeerdervoort commented Oct 3, 2018

Fix is very easy ;)

In Search.js, replace line 73

return '<a><strong>' + data.value + '</strong><p>' + data.description + '</p></a>'

with

return '<a><strong>'+data.value +'</p></a>'

@ohvitorino

This comment has been minimized.

Show comment
Hide comment
@ohvitorino

ohvitorino Oct 3, 2018

Contributor

@vanMeerdervoort if you have a solution, you should make a PR :)

Contributor

ohvitorino commented Oct 3, 2018

@vanMeerdervoort if you have a solution, you should make a PR :)

@vanMeerdervoort vanMeerdervoort referenced a pull request that will close this issue Oct 3, 2018

Open

Don't show description in autocomplete suggestion #2648

@StijnVrolijk

This comment has been minimized.

Show comment
Hide comment
@StijnVrolijk

StijnVrolijk Oct 3, 2018

Contributor

It's just a default.. some people might like the way it works. No need to get so worked up about it :)

That being said, there seems to be some mixup with text and description properties.
Also, \Frontend\Modules\Search\Ajax\Autosuggest:158 seems to contain a typo where test should be text

Contributor

StijnVrolijk commented Oct 3, 2018

It's just a default.. some people might like the way it works. No need to get so worked up about it :)

That being said, there seems to be some mixup with text and description properties.
Also, \Frontend\Modules\Search\Ajax\Autosuggest:158 seems to contain a typo where test should be text

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