Is it possible to add some text to the top of the search results?
Thanks.
The discussion revolves around adding custom text at the top of search results pages in Discourse. Jonathan5 initially asked if it’s possible, and Johani replied that there’s a plugin-outlet above the search results that can be used to add text. Johani provided a code snippet that can be added to the common > header tab in the theme to achieve this.
Jonathan5 successfully implemented the solution and expressed appreciation for Discourse’s mobile-friendliness. They also asked if there’s a way to find out about plugin-outlets without asking, and later found the answer in a previous discussion quoted here. The solution involves searching for plugin-outlet in the Discourse repository. Alternatively, Benjamin_D suggested using the Plugin Outlet Locations theme component to help find plugin-outlet locations.
Is it possible to add some text to the top of the search results?
Thanks.
Sure, there’s a plugin-outlet right above the search results on that page that you use to add text.
add this to the common > header tab in your theme
<script type="text/x-handlebars" data-template-name="/connectors/full-page-search-below-search-info/add-text-above-results">
Your text or markup goes here...
</script>
That worked perfectly, thanks.
Also the fact that I could do it in a minute on a phone shows how mobile-friendly Discourse is.
Is there a way to find out about these things without asking? Or would that require understanding the code in detail?
I think this is the answer to my supplementary question!
or perhaps this component can help:
(deprecated) Plugin outlet locations theme component