Tagged: headsearch, highlight, span
-
AuthorPosts
-
Ulysses Friend
Ulysses
- Join date:
- November 2012
- Posts:
- 36
- Downloads:
- 49
- Uploads:
- 12
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
July 18, 2017 at 7:33 am #1049419When searching utilizing the headsearch if the word matches correctly to the page; such as if you were searching "about".
One of the search results would read in the title the following;
<span class="highlight">about
-
Ulysses Friend
Ulysses
- Join date:
- November 2012
- Posts:
- 36
- Downloads:
- 49
- Uploads:
- 12
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
July 18, 2017 at 7:44 am #1049428I was able to find a workaround, not sure how safe it is; as it would have been nice to have even title highlighted if matched on the search page.
Below solved the issue, but it also keeps any title that matches the search query not to be highlighted.
Removing line 270 from components/com_search/views/search/view.html.php
Removing this string of code:
$result->title = StringHelper::str_ireplace($needle, $hl1 . $needle . $hl2, htmlspecialchars($result->title, ENT_COMPAT, 'UTF-8'));
The last battle that I am having with this search is that it is showing the page twice.
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
July 19, 2017 at 1:02 am #1049652Hi
I tested it with latest Joomla but not able to replicate this issue
Can you revert your changes and check the search page with default Joomla template and see how it goes?Ulysses FriendUlysses
- Join date:
- November 2012
- Posts:
- 36
- Downloads:
- 49
- Uploads:
- 12
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
July 19, 2017 at 6:20 am #1049706I was able to get to the bottom of the issue.
This duplicate pages with different urls’ were linked back to an EasyDiscuss plugin that needed to be disabled.As for the highlighted span class issue, this seems to be an issue with a lot of Joomla developers.
That was the only work around I could find and will have to suffice.Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
July 19, 2017 at 7:14 am #1049712Hi
I am not understanding the issue completely. Please check this issue with default Joomla template lile Beez3 and see how it goes?
With JA Nuevo template i have not noticed any issues.Regards
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)This topic contains 4 replies, has 2 voices, and was last updated by Pankaj Sharma 7 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum