Open thekenshow opened 2 years ago
Ok sorry for taking so long with this, but I looked into it yesterday and i kept running into minor issues (specifically with crawl) that kept me busy all day fixing.
I've now released a version 1.0.6
which should be available within the hour. This contains various minor fixes. Some of which may or may not help your issue. However, while trying to recreate the issue I did discover the combination of things that were missing in the default crawl
configuration that might of caused yours.
Specifically the front end config needed to be in the right place and have preview enabled:
aloglia-pro.yaml
:
crawl:
...
interface:
...
preview:
enabled: true
toc: true
...
Even after that I got the title showing, but no content summary.. That was because crawl also had another bit missing:
aloglia-pro.yaml
:
crawl:
...
interface:
...
search_params:
hitsPerPage: 20
distinct: true
snippetEllipsisText: '…'
attributesToSnippet: ['summary:50', 'content:50']
...
Specifically the attributesToSnippet
needed to contain summary:50
I suggest updating to 1.0.6 as there are some important 'crawl' things fixed that will definitely impact you, but I think your underlying issue is this configuration.
Thanks - I'll install 1.06 as soon as it's available, confirm the yaml changes above, and let you know what happens.
As of this morning, I'm still not seeing an update for this plugin:
Found 27 packages installed of which 2 need updating
Packages not found or not requiring updates: algolia-pro
Updated, applied changes noted above. re-indexed, cleared cache, still the same behaviour I originally described.
Your suggestions above had a different location for the search_params: section. You had:
crawl:
...
interface:
...
search_params:
hitsPerPage: 20
distinct: true
snippetEllipsisText: '…'
attributesToSnippet: ['summary:50', 'content:50']
...
But my config was:
crawl: ... search_params: hitsPerPage: 20 distinct: true snippetEllipsisText: … attributesToSnippet:
I tried all combinations of the syntax and locations:
Nothing made any difference.
Note that this site is PHP 7.3.33, in case that's a possible problem.
I can send a zipped user folder via discord DM.
Yes, please zip and send me the zipped user folder. I suspect you have some bad config.
Zip provided, please test and advise.
Ok, i was able to get this installed locally and I looked over you files. Those all looked fine to me. Ironically messing about with a gantry theme is too complicated for me, so i just switched to quark and put a trigger in the base.html.twig:
<button type="button" data-algolia-pro-trigger>Search</button>
{% include 'partials/algolia-pro/instantsearch.html.twig' ignore missing with { index: 'crawl' } %}
Then i tested with "Suppression" and it output the preview as expected:
Note, you do of course have to hover over an item to get a preview as nothing is selected by default.
Also i'm not using your domain specific config, only the default ones from user/config/
so maybe you might have some issue with the configs in troy*
folders.
I removed the domain-specific config and retested, same result. So user/config/plugins/algolia-pro.yaml
is not the problem.
I queried from the command line, and I get correct snippet results, so it's not Algolia.
Hovering makes no difference, and inspecting the page HTML shows there's nothing there to reveal by hovering ("Foam appears in the Marine Fire Safety snippet):
So what I'm hearing is the Algolia Pro plugin is not compatible with Gantry, but you're not able to go any further to find out why. Is that where this ends? Can @mahagr help?
can you first please confirm if this works for you in quark?
Done, it works properly - exactly as you described above.
Fwiw, I tried copying the templates/algolia-pro
and templates\partials
to the Gantry theme customization folder (user\data\gantry5\themes\rt_photon\templates
) and cleared caches, no change.
You can see here that there is a hidden
class that is causing this not to show. This should be removed by the JS (as you can see i removed the class manually and it shows) when there is a result hovered. I'm just not sure why this is working fine in Quark theme, but not in your theme, but clearly it's not a CSS conflict.
I think @w00fz is the only one that is boing to be able to determine what's going on here.
Right, I see that. Strange there wouldn't be a console message if it was a JS collision or fail. Looking forward to getting this sorted!
I'm going to lock this site down again but can reopen as needed.
Any update on this?
I determined that the hidden
class is assigned by default in hits_preview.html.twig
in the plugin. By editing that template to remove hidden
, the preview panel appears and works. Obviously, this breaks the configuration settings that would control the display of previews.
To avoid getting overwritten by plugin updates, I created user/data/gantry5/themes/rt_photon/templates/algolia-pro/blocks/hits_preview.html.twig
(custom RocketTheme, in my case) with the hidden
class removed.
So not fixed, but working, in case anyone else runs into this issue.
I'm not getting snippets for my algolia-crawl-pages index, just a list of page titles.
When I test it on Algolia (second image), i see a content section with highlighted matches:
Snippets do appear in CLI:
The inspector shows nothing hidden in HTML:
And the Console shows no related errors:
I can provide a zipped user folder if that helps to reproduce this.