We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is more of a question.
I have the plugin working great. However, I am struggling to get the custom fields to be indexed or outputted in results.
I have created the plugin as suggested in the readme and replaced with the field I want indexed.
{ public static function getSubscribedEvents() { return [ 'onTNTSearchIndex' => ['onTNTSearchIndex', 1000] ]; } public function onTNTSearchIndex(Event $e) { $fields = $e['fields']; $page = $e['page']; if (isset($page->header()->product_title)) { $fields->product_title = $page->header()->product_title; } } }
How can I check what is being indexed? If that is indexing the fields, How can i then output into the results? like this?
{% for key, val in tntsearch_results.hits %} <h3 class="large_title lightblue_font"> <a href="{{ base_url ~ val.link }}" style="font-size: 100%">{{ val.title }}</a> </h3> {% if config.get('plugins.tntsearch.display_route') %} <h6 class="route">{{ val.link }}</h6> {% endif %} <p>{{ val.content }}</p> <p>{{ val.header.product_title }}</p> {% endfor %}
Thanks
The text was updated successfully, but these errors were encountered:
The results that are actually available in a query is based on what you set in onTNTSearchQuery() event. By default this is:
onTNTSearchQuery()
https://github.com/trilbymedia/grav-plugin-tntsearch/blob/develop/tntsearch.php#L114-L136
more info on using your own custom results: https://github.com/trilbymedia/grav-plugin-tntsearch#customizing-query-data
Sorry, something went wrong.
No branches or pull requests
This is more of a question.
I have the plugin working great. However, I am struggling to get the custom fields to be indexed or outputted in results.
I have created the plugin as suggested in the readme and replaced with the field I want indexed.
How can I check what is being indexed?
If that is indexing the fields, How can i then output into the results? like this?
Thanks
The text was updated successfully, but these errors were encountered: